PCI: aardvark: Check return value of generic_handle_domain_irq() when processing...
authorPali Rohár <pali@kernel.org>
Mon, 10 Jan 2022 01:50:00 +0000 (02:50 +0100)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 8 Feb 2022 10:41:43 +0000 (10:41 +0000)
It is possible that we receive spurious INTx interrupt. Check for the
return value of generic_handle_domain_irq() when processing INTx IRQ.

Link: https://lore.kernel.org/r/20220110015018.26359-6-kabel@kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/controller/pci-aardvark.c

index d7ee7a2..0fb3847 100644 (file)
@@ -1425,7 +1425,9 @@ static void advk_pcie_handle_int(struct advk_pcie *pcie)
                advk_writel(pcie, PCIE_ISR1_INTX_ASSERT(i),
                            PCIE_ISR1_REG);
 
-               generic_handle_domain_irq(pcie->irq_domain, i);
+               if (generic_handle_domain_irq(pcie->irq_domain, i) == -EINVAL)
+                       dev_err_ratelimited(&pcie->pdev->dev, "unexpected INT%c IRQ\n",
+                                           (char)i + 'A');
        }
 }