linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] mhi: unconstify mhi_event_config
@ 2021-01-05 16:44 Loic Poulain
  2021-01-05 16:44 ` [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support Loic Poulain
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Loic Poulain @ 2021-01-05 16:44 UTC (permalink / raw)
  To: manivannan.sadhasivam, hemantk; +Cc: linux-arm-msm, Loic Poulain

Some parameters may have to be determined at runtime.
It is the case for the event ring MSI vector.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 v2: no change

 include/linux/mhi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mhi.h b/include/linux/mhi.h
index 62da830..48b1b2a 100644
--- a/include/linux/mhi.h
+++ b/include/linux/mhi.h
@@ -290,7 +290,7 @@ struct mhi_controller_config {
 	u32 num_channels;
 	const struct mhi_channel_config *ch_cfg;
 	u32 num_events;
-	const struct mhi_event_config *event_cfg;
+	struct mhi_event_config *event_cfg;
 	bool use_bounce_buf;
 	bool m2_no_db;
 };
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support
  2021-01-05 16:44 [PATCH v2 1/2] mhi: unconstify mhi_event_config Loic Poulain
@ 2021-01-05 16:44 ` Loic Poulain
  2021-01-06  2:14   ` Hemant Kumar
  2021-01-06 13:20   ` Manivannan Sadhasivam
  2021-01-06  2:28 ` [PATCH v2 1/2] mhi: unconstify mhi_event_config Hemant Kumar
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Loic Poulain @ 2021-01-05 16:44 UTC (permalink / raw)
  To: manivannan.sadhasivam, hemantk; +Cc: linux-arm-msm, Loic Poulain

When a shared MSI vector must be used (e.g. when VTd is disabled on
x86_64), each event MSI vector must be set to the shared vector idx.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 v2: reword MSI warning

 drivers/bus/mhi/pci_generic.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
index 86ff0c3..5b3a23a4 100644
--- a/drivers/bus/mhi/pci_generic.c
+++ b/drivers/bus/mhi/pci_generic.c
@@ -154,7 +154,7 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
 	MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 3),
 };
 
-static const struct mhi_event_config modem_qcom_v1_mhi_events[] = {
+static struct mhi_event_config modem_qcom_v1_mhi_events[] = {
 	/* first ring is control+data ring */
 	MHI_EVENT_CONFIG_CTRL(0),
 	/* DIAG dedicated event ring */
@@ -164,7 +164,7 @@ static const struct mhi_event_config modem_qcom_v1_mhi_events[] = {
 	MHI_EVENT_CONFIG_HW_DATA(3, 101)
 };
 
-static const struct mhi_controller_config modem_qcom_v1_mhiv_config = {
+static struct mhi_controller_config modem_qcom_v1_mhiv_config = {
 	.max_channels = 128,
 	.timeout_ms = 8000,
 	.num_channels = ARRAY_SIZE(modem_qcom_v1_mhi_channels),
@@ -295,8 +295,12 @@ static int mhi_pci_get_irqs(struct mhi_controller *mhi_cntrl,
 	}
 
 	if (nr_vectors < mhi_cntrl->nr_irqs) {
-		dev_warn(&pdev->dev, "Not enough MSI vectors (%d/%d), use shared MSI\n",
-			 nr_vectors, mhi_cntrl_config->num_events);
+		dev_warn(&pdev->dev, "using shared MSI\n");
+
+		/* Patch msi vectors, use only one (shared) */
+		for (i = 0; i < mhi_cntrl_config->num_events; i++)
+			mhi_cntrl_config->event_cfg[i].irq = 0;
+		mhi_cntrl->nr_irqs = 1;
 	}
 
 	irq = devm_kcalloc(&pdev->dev, mhi_cntrl->nr_irqs, sizeof(int), GFP_KERNEL);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support
  2021-01-05 16:44 ` [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support Loic Poulain
@ 2021-01-06  2:14   ` Hemant Kumar
  2021-01-06 13:20   ` Manivannan Sadhasivam
  1 sibling, 0 replies; 8+ messages in thread
From: Hemant Kumar @ 2021-01-06  2:14 UTC (permalink / raw)
  To: Loic Poulain, manivannan.sadhasivam; +Cc: linux-arm-msm



On 1/5/21 8:44 AM, Loic Poulain wrote:
> When a shared MSI vector must be used (e.g. when VTd is disabled on
> x86_64), each event MSI vector must be set to the shared vector idx.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---

Reviewed-by: Hemant Kumar<hemantk@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] mhi: unconstify mhi_event_config
  2021-01-05 16:44 [PATCH v2 1/2] mhi: unconstify mhi_event_config Loic Poulain
  2021-01-05 16:44 ` [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support Loic Poulain
@ 2021-01-06  2:28 ` Hemant Kumar
       [not found]   ` <CAMZdPi-m9WopviGqH+9XJdg7oi0wA4ASLkyXcqcBqrJdY_Oq8w@mail.gmail.com>
  2021-01-06 13:20 ` Manivannan Sadhasivam
  2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  3 siblings, 1 reply; 8+ messages in thread
From: Hemant Kumar @ 2021-01-06  2:28 UTC (permalink / raw)
  To: Loic Poulain, manivannan.sadhasivam; +Cc: linux-arm-msm

Hi Loic

On 1/5/21 8:44 AM, Loic Poulain wrote:
> Some parameters may have to be determined at runtime.
> It is the case for the event ring MSI vector.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   v2: no change
> 
>   include/linux/mhi.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> index 62da830..48b1b2a 100644
> --- a/include/linux/mhi.h
> +++ b/include/linux/mhi.h
> @@ -290,7 +290,7 @@ struct mhi_controller_config {
>   	u32 num_channels;
>   	const struct mhi_channel_config *ch_cfg;
>   	u32 num_events;
> -	const struct mhi_event_config *event_cfg;
> +	struct mhi_event_config *event_cfg;
commented on previous patch set, copying my comment here
Do we need to update mhi controller driver like ath11k and generic pci 
driver to avoid compiler warnings?
>   	bool use_bounce_buf;
>   	bool m2_no_db;
>   };
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] mhi: unconstify mhi_event_config
       [not found]   ` <CAMZdPi-m9WopviGqH+9XJdg7oi0wA4ASLkyXcqcBqrJdY_Oq8w@mail.gmail.com>
@ 2021-01-06 13:16     ` Manivannan Sadhasivam
  0 siblings, 0 replies; 8+ messages in thread
From: Manivannan Sadhasivam @ 2021-01-06 13:16 UTC (permalink / raw)
  To: Loic Poulain; +Cc: Hemant Kumar, linux-arm-msm

On Wed, Jan 06, 2021 at 09:39:27AM +0100, Loic Poulain wrote:
> Hi Hemant,
> 
> On Wed, 6 Jan 2021 at 03:28, Hemant Kumar <hemantk@codeaurora.org> wrote:
> 
> > Hi Loic
> >
> > On 1/5/21 8:44 AM, Loic Poulain wrote:
> > > Some parameters may have to be determined at runtime.
> > > It is the case for the event ring MSI vector.
> > >
> > > Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> > > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > > ---
> > >   v2: no change
> > >
> > >   include/linux/mhi.h | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> > > index 62da830..48b1b2a 100644
> > > --- a/include/linux/mhi.h
> > > +++ b/include/linux/mhi.h
> > > @@ -290,7 +290,7 @@ struct mhi_controller_config {
> > >       u32 num_channels;
> > >       const struct mhi_channel_config *ch_cfg;
> > >       u32 num_events;
> > > -     const struct mhi_event_config *event_cfg;
> > > +     struct mhi_event_config *event_cfg;
> > commented on previous patch set, copying my comment here
> > Do we need to update mhi controller driver like ath11k and generic pci
> > driver to avoid compiler warnings?
> >
> 
> ath11k does declare its mhi_event_config as const so it should not cause
> any issue. mhi_pci_generic event config is modified in 2/2.
> 

Ath11k doesn't declare it as const. It might be an issue before but not now ;)

Thanks,
Mani

> Regards,
> Loic

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] mhi: unconstify mhi_event_config
  2021-01-05 16:44 [PATCH v2 1/2] mhi: unconstify mhi_event_config Loic Poulain
  2021-01-05 16:44 ` [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support Loic Poulain
  2021-01-06  2:28 ` [PATCH v2 1/2] mhi: unconstify mhi_event_config Hemant Kumar
@ 2021-01-06 13:20 ` Manivannan Sadhasivam
  2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 8+ messages in thread
From: Manivannan Sadhasivam @ 2021-01-06 13:20 UTC (permalink / raw)
  To: Loic Poulain; +Cc: hemantk, linux-arm-msm

On Tue, Jan 05, 2021 at 05:44:35PM +0100, Loic Poulain wrote:
> Some parameters may have to be determined at runtime.
> It is the case for the event ring MSI vector.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Applied to mhi-next!

Thanks,
Mani

> ---
>  v2: no change
> 
>  include/linux/mhi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> index 62da830..48b1b2a 100644
> --- a/include/linux/mhi.h
> +++ b/include/linux/mhi.h
> @@ -290,7 +290,7 @@ struct mhi_controller_config {
>  	u32 num_channels;
>  	const struct mhi_channel_config *ch_cfg;
>  	u32 num_events;
> -	const struct mhi_event_config *event_cfg;
> +	struct mhi_event_config *event_cfg;
>  	bool use_bounce_buf;
>  	bool m2_no_db;
>  };
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support
  2021-01-05 16:44 ` [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support Loic Poulain
  2021-01-06  2:14   ` Hemant Kumar
@ 2021-01-06 13:20   ` Manivannan Sadhasivam
  1 sibling, 0 replies; 8+ messages in thread
From: Manivannan Sadhasivam @ 2021-01-06 13:20 UTC (permalink / raw)
  To: Loic Poulain; +Cc: hemantk, linux-arm-msm

On Tue, Jan 05, 2021 at 05:44:36PM +0100, Loic Poulain wrote:
> When a shared MSI vector must be used (e.g. when VTd is disabled on
> x86_64), each event MSI vector must be set to the shared vector idx.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Applied to mhi-next!

Thanks,
Mani

> ---
>  v2: reword MSI warning
> 
>  drivers/bus/mhi/pci_generic.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
> index 86ff0c3..5b3a23a4 100644
> --- a/drivers/bus/mhi/pci_generic.c
> +++ b/drivers/bus/mhi/pci_generic.c
> @@ -154,7 +154,7 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
>  	MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 3),
>  };
>  
> -static const struct mhi_event_config modem_qcom_v1_mhi_events[] = {
> +static struct mhi_event_config modem_qcom_v1_mhi_events[] = {
>  	/* first ring is control+data ring */
>  	MHI_EVENT_CONFIG_CTRL(0),
>  	/* DIAG dedicated event ring */
> @@ -164,7 +164,7 @@ static const struct mhi_event_config modem_qcom_v1_mhi_events[] = {
>  	MHI_EVENT_CONFIG_HW_DATA(3, 101)
>  };
>  
> -static const struct mhi_controller_config modem_qcom_v1_mhiv_config = {
> +static struct mhi_controller_config modem_qcom_v1_mhiv_config = {
>  	.max_channels = 128,
>  	.timeout_ms = 8000,
>  	.num_channels = ARRAY_SIZE(modem_qcom_v1_mhi_channels),
> @@ -295,8 +295,12 @@ static int mhi_pci_get_irqs(struct mhi_controller *mhi_cntrl,
>  	}
>  
>  	if (nr_vectors < mhi_cntrl->nr_irqs) {
> -		dev_warn(&pdev->dev, "Not enough MSI vectors (%d/%d), use shared MSI\n",
> -			 nr_vectors, mhi_cntrl_config->num_events);
> +		dev_warn(&pdev->dev, "using shared MSI\n");
> +
> +		/* Patch msi vectors, use only one (shared) */
> +		for (i = 0; i < mhi_cntrl_config->num_events; i++)
> +			mhi_cntrl_config->event_cfg[i].irq = 0;
> +		mhi_cntrl->nr_irqs = 1;
>  	}
>  
>  	irq = devm_kcalloc(&pdev->dev, mhi_cntrl->nr_irqs, sizeof(int), GFP_KERNEL);
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] mhi: unconstify mhi_event_config
  2021-01-05 16:44 [PATCH v2 1/2] mhi: unconstify mhi_event_config Loic Poulain
                   ` (2 preceding siblings ...)
  2021-01-06 13:20 ` Manivannan Sadhasivam
@ 2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-03-01 19:59 UTC (permalink / raw)
  To: Loic Poulain; +Cc: linux-arm-msm

Hello:

This series was applied to qcom/linux.git (refs/heads/for-next):

On Tue,  5 Jan 2021 17:44:35 +0100 you wrote:
> Some parameters may have to be determined at runtime.
> It is the case for the event ring MSI vector.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>  v2: no change
> 
> [...]

Here is the summary with links:
  - [v2,1/2] mhi: unconstify mhi_event_config
    https://git.kernel.org/qcom/c/fcba4b2047a3
  - [v2,2/2] mhi: pci_generic: Fix shared MSI vector support
    https://git.kernel.org/qcom/c/b91c3b30e226

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-01 20:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 16:44 [PATCH v2 1/2] mhi: unconstify mhi_event_config Loic Poulain
2021-01-05 16:44 ` [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support Loic Poulain
2021-01-06  2:14   ` Hemant Kumar
2021-01-06 13:20   ` Manivannan Sadhasivam
2021-01-06  2:28 ` [PATCH v2 1/2] mhi: unconstify mhi_event_config Hemant Kumar
     [not found]   ` <CAMZdPi-m9WopviGqH+9XJdg7oi0wA4ASLkyXcqcBqrJdY_Oq8w@mail.gmail.com>
2021-01-06 13:16     ` Manivannan Sadhasivam
2021-01-06 13:20 ` Manivannan Sadhasivam
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).