bus: mhi: Remove auto-start option
authorLoic Poulain <loic.poulain@linaro.org>
Mon, 28 Sep 2020 04:09:50 +0000 (09:39 +0530)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Wed, 18 Nov 2020 07:26:27 +0000 (12:56 +0530)
There is really no point having an auto-start for channels.
This is confusing for the device drivers, some have to enable the
channels, others don't have... and waste resources (e.g. pre allocated
buffers) that may never be used.

This is really up to the MHI device(channel) driver to manage the state
of its channels.

While at it, let's also remove the auto-start option from ath11k mhi
controller.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
[mani: clubbed ath11k change]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/bus/mhi/core/init.c
drivers/bus/mhi/core/internal.h
drivers/net/wireless/ath/ath11k/mhi.c
include/linux/mhi.h

index 0ffdebde826576f3baa525868a2ec416c63dd88b..381fdea2eb9fe4b623a7eeb9458732ad521b3f8c 100644 (file)
@@ -758,7 +758,6 @@ static int parse_ch_cfg(struct mhi_controller *mhi_cntrl,
                mhi_chan->offload_ch = ch_cfg->offload_channel;
                mhi_chan->db_cfg.reset_req = ch_cfg->doorbell_mode_switch;
                mhi_chan->pre_alloc = ch_cfg->auto_queue;
-               mhi_chan->auto_start = ch_cfg->auto_start;
 
                /*
                 * If MHI host allocates buffers, then the channel direction
@@ -1160,11 +1159,6 @@ static int mhi_driver_probe(struct device *dev)
                        goto exit_probe;
 
                ul_chan->xfer_cb = mhi_drv->ul_xfer_cb;
-               if (ul_chan->auto_start) {
-                       ret = mhi_prepare_channel(mhi_cntrl, ul_chan);
-                       if (ret)
-                               goto exit_probe;
-               }
        }
 
        ret = -EINVAL;
@@ -1198,9 +1192,6 @@ static int mhi_driver_probe(struct device *dev)
        if (ret)
                goto exit_probe;
 
-       if (dl_chan && dl_chan->auto_start)
-               mhi_prepare_channel(mhi_cntrl, dl_chan);
-
        mhi_device_put(mhi_dev);
 
        return ret;
index 7989269ddd9635d9bd6cb95194ac2758affec1e2..33c23203c5315c30f734a0d8b98aea46db310961 100644 (file)
@@ -563,7 +563,6 @@ struct mhi_chan {
        bool configured;
        bool offload_ch;
        bool pre_alloc;
-       bool auto_start;
        bool wake_capable;
 };
 
index aded9a719d51e9e128b37de350a9dd4247a0455b..47a1ce1bee4f4e4d52da916662462b03a2f4fb9a 100644 (file)
@@ -24,7 +24,6 @@ static struct mhi_channel_config ath11k_mhi_channels[] = {
                .offload_channel = false,
                .doorbell_mode_switch = false,
                .auto_queue = false,
-               .auto_start = false,
        },
        {
                .num = 1,
@@ -39,7 +38,6 @@ static struct mhi_channel_config ath11k_mhi_channels[] = {
                .offload_channel = false,
                .doorbell_mode_switch = false,
                .auto_queue = false,
-               .auto_start = false,
        },
        {
                .num = 20,
@@ -54,7 +52,6 @@ static struct mhi_channel_config ath11k_mhi_channels[] = {
                .offload_channel = false,
                .doorbell_mode_switch = false,
                .auto_queue = false,
-               .auto_start = true,
        },
        {
                .num = 21,
@@ -69,7 +66,6 @@ static struct mhi_channel_config ath11k_mhi_channels[] = {
                .offload_channel = false,
                .doorbell_mode_switch = false,
                .auto_queue = true,
-               .auto_start = true,
        },
 };
 
index d4841e5a5f458531123b635f1f134e8520fb1b8f..6522a4adc7947be0bf608cfdecd235fe5747af58 100644 (file)
@@ -214,7 +214,6 @@ enum mhi_db_brst_mode {
  * @offload_channel: The client manages the channel completely
  * @doorbell_mode_switch: Channel switches to doorbell mode on M0 transition
  * @auto_queue: Framework will automatically queue buffers for DL traffic
- * @auto_start: Automatically start (open) this channel
  * @wake-capable: Channel capable of waking up the system
  */
 struct mhi_channel_config {
@@ -232,7 +231,6 @@ struct mhi_channel_config {
        bool offload_channel;
        bool doorbell_mode_switch;
        bool auto_queue;
-       bool auto_start;
        bool wake_capable;
 };