* [PATCH v4] PCI: mediatek: Clear interrupt status before dispatching handler
@ 2023-12-11 9:49 Jianjun Wang
2024-01-08 14:30 ` Krzysztof Wilczyński
0 siblings, 1 reply; 2+ messages in thread
From: Jianjun Wang @ 2023-12-11 9:49 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Matthias Brugger, AngeloGioacchino Del Regno
Cc: Ryder Lee, Jianjun Wang, linux-pci, linux-mediatek, linux-kernel,
linux-arm-kernel, qizhong.cheng, stable
From: qizhong cheng <qizhong.cheng@mediatek.com>
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.
Fixes: 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: stable@vger.kernel.org
---
v4:
- Found that this patch has not been merged, resending it as v4.
v3:
- Add Fix tag.
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 66a8f73296fc..3fb7f08de061 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -617,12 +617,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.18.0
_______________________________________________
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] 2+ messages in thread* Re: [PATCH v4] PCI: mediatek: Clear interrupt status before dispatching handler
2023-12-11 9:49 [PATCH v4] PCI: mediatek: Clear interrupt status before dispatching handler Jianjun Wang
@ 2024-01-08 14:30 ` Krzysztof Wilczyński
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Wilczyński @ 2024-01-08 14:30 UTC (permalink / raw)
To: Jianjun Wang
Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Matthias Brugger,
AngeloGioacchino Del Regno, Ryder Lee, linux-pci, linux-mediatek,
linux-kernel, linux-arm-kernel, qizhong.cheng, stable
Hello,
> 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.
Applied to controller/mediatek, thank you!
[1/1] PCI: mediatek: Clear interrupt status before dispatching handler
https://git.kernel.org/pci/pci/c/4fea201e110e
Krzysztof
_______________________________________________
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] 2+ messages in thread
end of thread, other threads:[~2024-01-08 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-11 9:49 [PATCH v4] PCI: mediatek: Clear interrupt status before dispatching handler Jianjun Wang
2024-01-08 14:30 ` Krzysztof Wilczyński
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).