blob: d3ef78dc7292092f715282d4ecf42075394d34f7 [file] [log] [blame]
developerf11ee162022-04-12 11:17:45 +08001From: Felix Fietkau <nbd@nbd.name>
2Date: Fri, 4 Sep 2020 18:33:27 +0200
3Subject: [PATCH] pcie-mediatek: fix clearing interrupt status
4
5Clearing the status needs to happen after running the handler, otherwise
6we will get an extra spurious interrupt after the cause has been cleared
7
8Signed-off-by: Felix Fietkau <nbd@nbd.name>
9---
10
11--- a/drivers/pci/controller/pcie-mediatek.c
12+++ b/drivers/pci/controller/pcie-mediatek.c
13@@ -616,10 +616,10 @@ static void mtk_pcie_intr_handler(struct
14 if (status & INTX_MASK) {
15 for_each_set_bit_from(bit, &status, PCI_NUM_INTX + INTX_SHIFT) {
16 /* Clear the INTx */
17- writel(1 << bit, port->base + PCIE_INT_STATUS);
18 virq = irq_find_mapping(port->irq_domain,
19 bit - INTX_SHIFT);
20 generic_handle_irq(virq);
21+ writel(1 << bit, port->base + PCIE_INT_STATUS);
22 }
23 }
24