All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2022-02-10  1:21 ` qizhong cheng
  0 siblings, 0 replies; 11+ messages in thread
From: qizhong cheng @ 2022-02-10  1:21 UTC (permalink / raw)
  To: Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	stable, qizhong.cheng, chuanjia.liu

We found a failure when used iperf tool for wifi performance testing,
there are some MSIs received while clearing the interrupt status,
these MSIs cannot be serviced.

The interrupt status can be cleared even the MSI status still remaining,
as an edge-triggered interrupts, its interrupt status should be cleared
before dispatching to the handler of device.

Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
---
v2:
 - Update the subject line.
 - Improve the commit log and code comments.

 drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index 2f3f974977a3..2856d74b2513 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -624,12 +624,17 @@ static void mtk_pcie_intr_handler(struct irq_desc *desc)
 		if (status & MSI_STATUS){
 			unsigned long imsi_status;
 
+			/*
+			 * The interrupt status can be cleared even the MSI
+			 * status still remaining, hence as an edge-triggered
+			 * interrupts, its interrupt status should be cleared
+			 * before dispatching handler.
+			 */
+			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
 			while ((imsi_status = readl(port->base + PCIE_IMSI_STATUS))) {
 				for_each_set_bit(bit, &imsi_status, MTK_MSI_IRQS_NUM)
 					generic_handle_domain_irq(port->inner_domain, bit);
 			}
-			/* Clear MSI interrupt status */
-			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
 		}
 	}
 
-- 
2.25.1


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

* [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2022-02-10  1:21 ` qizhong cheng
  0 siblings, 0 replies; 11+ messages in thread
From: qizhong cheng @ 2022-02-10  1:21 UTC (permalink / raw)
  To: Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	stable, qizhong.cheng, chuanjia.liu

We found a failure when used iperf tool for wifi performance testing,
there are some MSIs received while clearing the interrupt status,
these MSIs cannot be serviced.

The interrupt status can be cleared even the MSI status still remaining,
as an edge-triggered interrupts, its interrupt status should be cleared
before dispatching to the handler of device.

Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
---
v2:
 - Update the subject line.
 - Improve the commit log and code comments.

 drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index 2f3f974977a3..2856d74b2513 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -624,12 +624,17 @@ static void mtk_pcie_intr_handler(struct irq_desc *desc)
 		if (status & MSI_STATUS){
 			unsigned long imsi_status;
 
+			/*
+			 * The interrupt status can be cleared even the MSI
+			 * status still remaining, hence as an edge-triggered
+			 * interrupts, its interrupt status should be cleared
+			 * before dispatching handler.
+			 */
+			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
 			while ((imsi_status = readl(port->base + PCIE_IMSI_STATUS))) {
 				for_each_set_bit(bit, &imsi_status, MTK_MSI_IRQS_NUM)
 					generic_handle_domain_irq(port->inner_domain, bit);
 			}
-			/* Clear MSI interrupt status */
-			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
 		}
 	}
 
-- 
2.25.1


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2022-02-10  1:21 ` qizhong cheng
  0 siblings, 0 replies; 11+ messages in thread
From: qizhong cheng @ 2022-02-10  1:21 UTC (permalink / raw)
  To: Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	stable, qizhong.cheng, chuanjia.liu

We found a failure when used iperf tool for wifi performance testing,
there are some MSIs received while clearing the interrupt status,
these MSIs cannot be serviced.

The interrupt status can be cleared even the MSI status still remaining,
as an edge-triggered interrupts, its interrupt status should be cleared
before dispatching to the handler of device.

Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
---
v2:
 - Update the subject line.
 - Improve the commit log and code comments.

 drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index 2f3f974977a3..2856d74b2513 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -624,12 +624,17 @@ static void mtk_pcie_intr_handler(struct irq_desc *desc)
 		if (status & MSI_STATUS){
 			unsigned long imsi_status;
 
+			/*
+			 * The interrupt status can be cleared even the MSI
+			 * status still remaining, hence as an edge-triggered
+			 * interrupts, its interrupt status should be cleared
+			 * before dispatching handler.
+			 */
+			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
 			while ((imsi_status = readl(port->base + PCIE_IMSI_STATUS))) {
 				for_each_set_bit(bit, &imsi_status, MTK_MSI_IRQS_NUM)
 					generic_handle_domain_irq(port->inner_domain, bit);
 			}
-			/* Clear MSI interrupt status */
-			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
 		}
 	}
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
  2022-02-10  1:21 ` qizhong cheng
  (?)
@ 2022-02-10  6:50   ` Greg KH
  -1 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2022-02-10  6:50 UTC (permalink / raw)
  To: qizhong cheng
  Cc: Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, linux-pci,
	linux-mediatek, linux-kernel, linux-arm-kernel, stable,
	chuanjia.liu

On Thu, Feb 10, 2022 at 09:21:25AM +0800, qizhong cheng wrote:
> We found a failure when used iperf tool for wifi performance testing,
> there are some MSIs received while clearing the interrupt status,
> these MSIs cannot be serviced.
> 
> The interrupt status can be cleared even the MSI status still remaining,
> as an edge-triggered interrupts, its interrupt status should be cleared
> before dispatching to the handler of device.
> 
> Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
> ---
> v2:
>  - Update the subject line.
>  - Improve the commit log and code comments.
> 
>  drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

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

* Re: [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2022-02-10  6:50   ` Greg KH
  0 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2022-02-10  6:50 UTC (permalink / raw)
  To: qizhong cheng
  Cc: Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, linux-pci,
	linux-mediatek, linux-kernel, linux-arm-kernel, stable,
	chuanjia.liu

On Thu, Feb 10, 2022 at 09:21:25AM +0800, qizhong cheng wrote:
> We found a failure when used iperf tool for wifi performance testing,
> there are some MSIs received while clearing the interrupt status,
> these MSIs cannot be serviced.
> 
> The interrupt status can be cleared even the MSI status still remaining,
> as an edge-triggered interrupts, its interrupt status should be cleared
> before dispatching to the handler of device.
> 
> Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
> ---
> v2:
>  - Update the subject line.
>  - Improve the commit log and code comments.
> 
>  drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2022-02-10  6:50   ` Greg KH
  0 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2022-02-10  6:50 UTC (permalink / raw)
  To: qizhong cheng
  Cc: Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, linux-pci,
	linux-mediatek, linux-kernel, linux-arm-kernel, stable,
	chuanjia.liu

On Thu, Feb 10, 2022 at 09:21:25AM +0800, qizhong cheng wrote:
> We found a failure when used iperf tool for wifi performance testing,
> there are some MSIs received while clearing the interrupt status,
> these MSIs cannot be serviced.
> 
> The interrupt status can be cleared even the MSI status still remaining,
> as an edge-triggered interrupts, its interrupt status should be cleared
> before dispatching to the handler of device.
> 
> Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
> ---
> v2:
>  - Update the subject line.
>  - Improve the commit log and code comments.
> 
>  drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
  2022-02-10  1:21 ` qizhong cheng
  (?)
@ 2022-02-10 14:31   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-02-10 14:31 UTC (permalink / raw)
  To: qizhong cheng, Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	stable, chuanjia.liu

Il 10/02/22 02:21, qizhong cheng ha scritto:
> We found a failure when used iperf tool for wifi performance testing,
> there are some MSIs received while clearing the interrupt status,
> these MSIs cannot be serviced.
> 
> The interrupt status can be cleared even the MSI status still remaining,
> as an edge-triggered interrupts, its interrupt status should be cleared
> before dispatching to the handler of device.
> 
> Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>

Hello Qizhong,

This commit is fixing an issue, which means that you *have to* add a proper
Fixes tag.

I believe that this is fixing commit
43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622").

Please add the tag and send a v3, after which:
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


> ---
> v2:
>   - Update the subject line.
>   - Improve the commit log and code comments.
> 
>   drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
> index 2f3f974977a3..2856d74b2513 100644
> --- a/drivers/pci/controller/pcie-mediatek.c
> +++ b/drivers/pci/controller/pcie-mediatek.c
> @@ -624,12 +624,17 @@ static void mtk_pcie_intr_handler(struct irq_desc *desc)
>   		if (status & MSI_STATUS){
>   			unsigned long imsi_status;
>   
> +			/*
> +			 * The interrupt status can be cleared even the MSI
> +			 * status still remaining, hence as an edge-triggered
> +			 * interrupts, its interrupt status should be cleared
> +			 * before dispatching handler.
> +			 */
> +			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
>   			while ((imsi_status = readl(port->base + PCIE_IMSI_STATUS))) {
>   				for_each_set_bit(bit, &imsi_status, MTK_MSI_IRQS_NUM)
>   					generic_handle_domain_irq(port->inner_domain, bit);
>   			}
> -			/* Clear MSI interrupt status */
> -			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
>   		}
>   	}
>   
> 



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

* Re: [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2022-02-10 14:31   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-02-10 14:31 UTC (permalink / raw)
  To: qizhong cheng, Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	stable, chuanjia.liu

Il 10/02/22 02:21, qizhong cheng ha scritto:
> We found a failure when used iperf tool for wifi performance testing,
> there are some MSIs received while clearing the interrupt status,
> these MSIs cannot be serviced.
> 
> The interrupt status can be cleared even the MSI status still remaining,
> as an edge-triggered interrupts, its interrupt status should be cleared
> before dispatching to the handler of device.
> 
> Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>

Hello Qizhong,

This commit is fixing an issue, which means that you *have to* add a proper
Fixes tag.

I believe that this is fixing commit
43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622").

Please add the tag and send a v3, after which:
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


> ---
> v2:
>   - Update the subject line.
>   - Improve the commit log and code comments.
> 
>   drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
> index 2f3f974977a3..2856d74b2513 100644
> --- a/drivers/pci/controller/pcie-mediatek.c
> +++ b/drivers/pci/controller/pcie-mediatek.c
> @@ -624,12 +624,17 @@ static void mtk_pcie_intr_handler(struct irq_desc *desc)
>   		if (status & MSI_STATUS){
>   			unsigned long imsi_status;
>   
> +			/*
> +			 * The interrupt status can be cleared even the MSI
> +			 * status still remaining, hence as an edge-triggered
> +			 * interrupts, its interrupt status should be cleared
> +			 * before dispatching handler.
> +			 */
> +			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
>   			while ((imsi_status = readl(port->base + PCIE_IMSI_STATUS))) {
>   				for_each_set_bit(bit, &imsi_status, MTK_MSI_IRQS_NUM)
>   					generic_handle_domain_irq(port->inner_domain, bit);
>   			}
> -			/* Clear MSI interrupt status */
> -			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
>   		}
>   	}
>   
> 



_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2022-02-10 14:31   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-02-10 14:31 UTC (permalink / raw)
  To: qizhong cheng, Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	stable, chuanjia.liu

Il 10/02/22 02:21, qizhong cheng ha scritto:
> We found a failure when used iperf tool for wifi performance testing,
> there are some MSIs received while clearing the interrupt status,
> these MSIs cannot be serviced.
> 
> The interrupt status can be cleared even the MSI status still remaining,
> as an edge-triggered interrupts, its interrupt status should be cleared
> before dispatching to the handler of device.
> 
> Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>

Hello Qizhong,

This commit is fixing an issue, which means that you *have to* add a proper
Fixes tag.

I believe that this is fixing commit
43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622").

Please add the tag and send a v3, after which:
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


> ---
> v2:
>   - Update the subject line.
>   - Improve the commit log and code comments.
> 
>   drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
> index 2f3f974977a3..2856d74b2513 100644
> --- a/drivers/pci/controller/pcie-mediatek.c
> +++ b/drivers/pci/controller/pcie-mediatek.c
> @@ -624,12 +624,17 @@ static void mtk_pcie_intr_handler(struct irq_desc *desc)
>   		if (status & MSI_STATUS){
>   			unsigned long imsi_status;
>   
> +			/*
> +			 * The interrupt status can be cleared even the MSI
> +			 * status still remaining, hence as an edge-triggered
> +			 * interrupts, its interrupt status should be cleared
> +			 * before dispatching handler.
> +			 */
> +			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
>   			while ((imsi_status = readl(port->base + PCIE_IMSI_STATUS))) {
>   				for_each_set_bit(bit, &imsi_status, MTK_MSI_IRQS_NUM)
>   					generic_handle_domain_irq(port->inner_domain, bit);
>   			}
> -			/* Clear MSI interrupt status */
> -			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
>   		}
>   	}
>   
> 



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
  2022-02-10 14:31   ` AngeloGioacchino Del Regno
@ 2022-02-11  6:50     ` qizhong.cheng
  -1 siblings, 0 replies; 11+ messages in thread
From: qizhong.cheng @ 2022-02-11  6:50 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, Ryder Lee, Jianjun Wang,
	Lorenzo Pieralisi, Krzysztof Wilczyński, Bjorn Helgaas
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel, chuanjia.liu

Hi AngeloGioacchino & Greg KH,

On Thu, 2022-02-10 at 15:31 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/02/22 02:21, qizhong cheng ha scritto:
> > We found a failure when used iperf tool for wifi performance
> > testing,
> > there are some MSIs received while clearing the interrupt status,
> > these MSIs cannot be serviced.
> > 
> > The interrupt status can be cleared even the MSI status still
> > remaining,
> > as an edge-triggered interrupts, its interrupt status should be
> > cleared
> > before dispatching to the handler of device.
> > 
> > Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
> 
> Hello Qizhong,
> 
> This commit is fixing an issue, which means that you *have to* add a
> proper
> Fixes tag.
> 
> I believe that this is fixing commit
> 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and
> MT7622").
> 
> Please add the tag and send a v3, after which:
> Reviewed-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> 

Thanks for your reviews and suggestions.
I will fix it in the next v3 version.

> 
> > ---
> > v2:
> >   - Update the subject line.
> >   - Improve the commit log and code comments.
> > 
> >   drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
> >   1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/pci/controller/pcie-mediatek.c
> > b/drivers/pci/controller/pcie-mediatek.c
> > index 2f3f974977a3..2856d74b2513 100644
> > --- a/drivers/pci/controller/pcie-mediatek.c
> > +++ b/drivers/pci/controller/pcie-mediatek.c
> > @@ -624,12 +624,17 @@ static void mtk_pcie_intr_handler(struct
> > irq_desc *desc)
> >   		if (status & MSI_STATUS){
> >   			unsigned long imsi_status;
> >   
> > +			/*
> > +			 * The interrupt status can be cleared even the
> > MSI
> > +			 * status still remaining, hence as an edge-
> > triggered
> > +			 * interrupts, its interrupt status should be
> > cleared
> > +			 * before dispatching handler.
> > +			 */
> > +			writel(MSI_STATUS, port->base +
> > PCIE_INT_STATUS);
> >   			while ((imsi_status = readl(port->base +
> > PCIE_IMSI_STATUS))) {
> >   				for_each_set_bit(bit, &imsi_status,
> > MTK_MSI_IRQS_NUM)
> >   					generic_handle_domain_irq(port-
> > >inner_domain, bit);
> >   			}
> > -			/* Clear MSI interrupt status */
> > -			writel(MSI_STATUS, port->base +
> > PCIE_INT_STATUS);
> >   		}
> >   	}
> >   
> > 
> 
> 
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2022-02-11  6:50     ` qizhong.cheng
  0 siblings, 0 replies; 11+ messages in thread
From: qizhong.cheng @ 2022-02-11  6:50 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, Ryder Lee, Jianjun Wang,
	Lorenzo Pieralisi, Krzysztof Wilczyński, Bjorn Helgaas
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel, chuanjia.liu

Hi AngeloGioacchino & Greg KH,

On Thu, 2022-02-10 at 15:31 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/02/22 02:21, qizhong cheng ha scritto:
> > We found a failure when used iperf tool for wifi performance
> > testing,
> > there are some MSIs received while clearing the interrupt status,
> > these MSIs cannot be serviced.
> > 
> > The interrupt status can be cleared even the MSI status still
> > remaining,
> > as an edge-triggered interrupts, its interrupt status should be
> > cleared
> > before dispatching to the handler of device.
> > 
> > Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
> 
> Hello Qizhong,
> 
> This commit is fixing an issue, which means that you *have to* add a
> proper
> Fixes tag.
> 
> I believe that this is fixing commit
> 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and
> MT7622").
> 
> Please add the tag and send a v3, after which:
> Reviewed-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> 

Thanks for your reviews and suggestions.
I will fix it in the next v3 version.

> 
> > ---
> > v2:
> >   - Update the subject line.
> >   - Improve the commit log and code comments.
> > 
> >   drivers/pci/controller/pcie-mediatek.c | 9 +++++++--
> >   1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/pci/controller/pcie-mediatek.c
> > b/drivers/pci/controller/pcie-mediatek.c
> > index 2f3f974977a3..2856d74b2513 100644
> > --- a/drivers/pci/controller/pcie-mediatek.c
> > +++ b/drivers/pci/controller/pcie-mediatek.c
> > @@ -624,12 +624,17 @@ static void mtk_pcie_intr_handler(struct
> > irq_desc *desc)
> >   		if (status & MSI_STATUS){
> >   			unsigned long imsi_status;
> >   
> > +			/*
> > +			 * The interrupt status can be cleared even the
> > MSI
> > +			 * status still remaining, hence as an edge-
> > triggered
> > +			 * interrupts, its interrupt status should be
> > cleared
> > +			 * before dispatching handler.
> > +			 */
> > +			writel(MSI_STATUS, port->base +
> > PCIE_INT_STATUS);
> >   			while ((imsi_status = readl(port->base +
> > PCIE_IMSI_STATUS))) {
> >   				for_each_set_bit(bit, &imsi_status,
> > MTK_MSI_IRQS_NUM)
> >   					generic_handle_domain_irq(port-
> > >inner_domain, bit);
> >   			}
> > -			/* Clear MSI interrupt status */
> > -			writel(MSI_STATUS, port->base +
> > PCIE_INT_STATUS);
> >   		}
> >   	}
> >   
> > 
> 
> 
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-02-11  6:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10  1:21 [PATCH v2] PCI: mediatek: Clear interrupt status before dispatching handler qizhong cheng
2022-02-10  1:21 ` qizhong cheng
2022-02-10  1:21 ` qizhong cheng
2022-02-10  6:50 ` Greg KH
2022-02-10  6:50   ` Greg KH
2022-02-10  6:50   ` Greg KH
2022-02-10 14:31 ` AngeloGioacchino Del Regno
2022-02-10 14:31   ` AngeloGioacchino Del Regno
2022-02-10 14:31   ` AngeloGioacchino Del Regno
2022-02-11  6:50   ` qizhong.cheng
2022-02-11  6:50     ` qizhong.cheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.