diff mbox series

mhi: pci_generic: Fix inbound IPCR channel

Message ID 1625736749-24947-1-git-send-email-loic.poulain@linaro.org
State Accepted
Commit b8a97f2a65388394f433bf0730293a94f7d49046
Headers show
Series mhi: pci_generic: Fix inbound IPCR channel | expand

Commit Message

Loic Poulain July 8, 2021, 9:32 a.m. UTC
The qrtr-mhi client driver assumes that inbound buffers are
automatically allocated and queued by the MHI core, but this
no happens for mhi pci devices since IPCR inbound channel is
not flagged with auto_queue, causing unusable IPCR (qrtr)
feature. Fix that.

Cc: stable@vger.kernel.org
Fixes: 855a70c12021 ("bus: mhi: Add MHI PCI support for WWAN modems")
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/bus/mhi/pci_generic.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Comments

Hemant Kumar July 8, 2021, 5:37 p.m. UTC | #1
On Thu, 2021-07-08 at 11:32 +0200, Loic Poulain wrote:
> The qrtr-mhi client driver assumes that inbound buffers are
> automatically allocated and queued by the MHI core, but this
> no happens for mhi pci devices since IPCR inbound channel is
does not happen for mhi pci devices since IPCR inbound channel is
> not flagged with auto_queue, causing unusable IPCR (qrtr)
> feature. Fix that.
> 
> Cc: stable@vger.kernel.org
> Fixes: 855a70c12021 ("bus: mhi: Add MHI PCI support for WWAN modems")
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
With commit text update 

Reviewed-by: Hemant kumar <hemantk@codeaurora.org>
> [..]
Manivannan Sadhasivam July 16, 2021, 7:21 a.m. UTC | #2
On Thu, Jul 08, 2021 at 11:32:29AM +0200, Loic Poulain wrote:
> The qrtr-mhi client driver assumes that inbound buffers are

> automatically allocated and queued by the MHI core, but this

> no happens for mhi pci devices since IPCR inbound channel is

> not flagged with auto_queue, causing unusable IPCR (qrtr)

> feature. Fix that.

> 

> Cc: stable@vger.kernel.org

> Fixes: 855a70c12021 ("bus: mhi: Add MHI PCI support for WWAN modems")

> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>


Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>


Thanks,
Mani

> ---

>  drivers/bus/mhi/pci_generic.c | 18 +++++++++++++++++-

>  1 file changed, 17 insertions(+), 1 deletion(-)

> 

> diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c

> index 8bc6149..6d2ddec 100644

> --- a/drivers/bus/mhi/pci_generic.c

> +++ b/drivers/bus/mhi/pci_generic.c

> @@ -75,6 +75,22 @@ struct mhi_pci_dev_info {

>  		.doorbell_mode_switch = false,		\

>  	}

>  

> +#define MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(ch_num, ch_name, el_count, ev_ring) \

> +	{						\

> +		.num = ch_num,				\

> +		.name = ch_name,			\

> +		.num_elements = el_count,		\

> +		.event_ring = ev_ring,			\

> +		.dir = DMA_FROM_DEVICE,			\

> +		.ee_mask = BIT(MHI_EE_AMSS),		\

> +		.pollcfg = 0,				\

> +		.doorbell = MHI_DB_BRST_DISABLE,	\

> +		.lpm_notify = false,			\

> +		.offload_channel = false,		\

> +		.doorbell_mode_switch = false,		\

> +		.auto_queue = true,			\

> +	}

> +

>  #define MHI_EVENT_CONFIG_CTRL(ev_ring, el_count) \

>  	{					\

>  		.num_elements = el_count,	\

> @@ -213,7 +229,7 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {

>  	MHI_CHANNEL_CONFIG_UL(14, "QMI", 4, 0),

>  	MHI_CHANNEL_CONFIG_DL(15, "QMI", 4, 0),

>  	MHI_CHANNEL_CONFIG_UL(20, "IPCR", 8, 0),

> -	MHI_CHANNEL_CONFIG_DL(21, "IPCR", 8, 0),

> +	MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(21, "IPCR", 8, 0),

>  	MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),

>  	MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),

>  	MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 2),

> -- 

> 2.7.4

>
diff mbox series

Patch

diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
index 8bc6149..6d2ddec 100644
--- a/drivers/bus/mhi/pci_generic.c
+++ b/drivers/bus/mhi/pci_generic.c
@@ -75,6 +75,22 @@  struct mhi_pci_dev_info {
 		.doorbell_mode_switch = false,		\
 	}
 
+#define MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(ch_num, ch_name, el_count, ev_ring) \
+	{						\
+		.num = ch_num,				\
+		.name = ch_name,			\
+		.num_elements = el_count,		\
+		.event_ring = ev_ring,			\
+		.dir = DMA_FROM_DEVICE,			\
+		.ee_mask = BIT(MHI_EE_AMSS),		\
+		.pollcfg = 0,				\
+		.doorbell = MHI_DB_BRST_DISABLE,	\
+		.lpm_notify = false,			\
+		.offload_channel = false,		\
+		.doorbell_mode_switch = false,		\
+		.auto_queue = true,			\
+	}
+
 #define MHI_EVENT_CONFIG_CTRL(ev_ring, el_count) \
 	{					\
 		.num_elements = el_count,	\
@@ -213,7 +229,7 @@  static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
 	MHI_CHANNEL_CONFIG_UL(14, "QMI", 4, 0),
 	MHI_CHANNEL_CONFIG_DL(15, "QMI", 4, 0),
 	MHI_CHANNEL_CONFIG_UL(20, "IPCR", 8, 0),
-	MHI_CHANNEL_CONFIG_DL(21, "IPCR", 8, 0),
+	MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(21, "IPCR", 8, 0),
 	MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
 	MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
 	MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 2),