[openwrt/openwrt] mediatek: fix an irq handling issue

LEDE Commits lede-commits at lists.infradead.org
Fri Sep 4 13:42:47 EDT 2020


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/44fe9e6f84ee25e04391e467a177e57c783d1975

commit 44fe9e6f84ee25e04391e467a177e57c783d1975
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Sep 4 19:41:33 2020 +0200

    mediatek: fix an irq handling issue
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...ie-mediatek-fix-clearing-interrupt-status.patch | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/target/linux/mediatek/patches-5.4/1010-pcie-mediatek-fix-clearing-interrupt-status.patch b/target/linux/mediatek/patches-5.4/1010-pcie-mediatek-fix-clearing-interrupt-status.patch
new file mode 100644
index 0000000000..d3ef78dc72
--- /dev/null
+++ b/target/linux/mediatek/patches-5.4/1010-pcie-mediatek-fix-clearing-interrupt-status.patch
@@ -0,0 +1,24 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Fri, 4 Sep 2020 18:33:27 +0200
+Subject: [PATCH] pcie-mediatek: fix clearing interrupt status
+
+Clearing the status needs to happen after running the handler, otherwise
+we will get an extra spurious interrupt after the cause has been cleared
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/pci/controller/pcie-mediatek.c
++++ b/drivers/pci/controller/pcie-mediatek.c
+@@ -616,10 +616,10 @@ static void mtk_pcie_intr_handler(struct
+ 	if (status & INTX_MASK) {
+ 		for_each_set_bit_from(bit, &status, PCI_NUM_INTX + INTX_SHIFT) {
+ 			/* Clear the INTx */
+-			writel(1 << bit, port->base + PCIE_INT_STATUS);
+ 			virq = irq_find_mapping(port->irq_domain,
+ 						bit - INTX_SHIFT);
+ 			generic_handle_irq(virq);
++			writel(1 << bit, port->base + PCIE_INT_STATUS);
+ 		}
+ 	}
+ 



More information about the lede-commits mailing list