66e9b32e4d08192cdc6c24bc1ac8a992ba05d4cb
[openwrt/staging/chunkeey.git] / target / linux / generic / pending-5.10 / 850-0005-PCI-aardvark-Check-return-value-of-generic_handle_do.patch
1 From 69c1f2c6f45a556361fd8e8d2d4eb20e2c8d3d95 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Thu, 18 Mar 2021 17:04:32 +0100
4 Subject: [PATCH] PCI: aardvark: Check return value of
5 generic_handle_domain_irq() when processing INTx IRQ
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 It is possible that we receive spurious INTx interrupt. Check for the
11 return value of generic_handle_domain_irq() when processing INTx IRQ.
12
13 Signed-off-by: Pali Rohár <pali@kernel.org>
14 Signed-off-by: Marek Behún <kabel@kernel.org>
15 ---
16 drivers/pci/controller/pci-aardvark.c | 4 +++-
17 1 file changed, 3 insertions(+), 1 deletion(-)
18
19 --- a/drivers/pci/controller/pci-aardvark.c
20 +++ b/drivers/pci/controller/pci-aardvark.c
21 @@ -1437,7 +1437,9 @@ static void advk_pcie_handle_int(struct
22 PCIE_ISR1_REG);
23
24 virq = irq_find_mapping(pcie->irq_domain, i);
25 - generic_handle_irq(virq);
26 + if (generic_handle_irq(virq) == -EINVAL)
27 + dev_err_ratelimited(&pcie->pdev->dev, "unexpected INT%c IRQ\n",
28 + (char)i + 'A');
29 }
30 }
31