From 7562fbfa12b7fe6235c5e88f4746ee6dad04df8b Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Wed, 8 Feb 2023 16:46:42 +0530 Subject: [PATCH] NVIDIA: SAUCE: of/irq: Adjust of_pci_irq parsing for multiple interrupts BugLink: https://bugs.launchpad.net/bugs/2080908 Currently we are considering the first irq as the PCI interrupt pin, but a PCI device may have multiple interrupts(e.g. PCIe WAKE# pin). Only parse the PCI interrupt pin when the irq is unnamed or named as "pci". http://nvbugs/4478230 Signed-off-by: Jeffy Chen Signed-off-by: Manikanta Maddireddy Reviewed-by: Thierry Reding (cherry-picked from https://patchwork.ozlabs.org/project/linux-pci/ patch/20230208111645.3863534-3-mmaddireddy@nvidia.com) Signed-off-by: Laxman Dewangan Acked-by: Noah Wager Acked-by: Jacob Martin Signed-off-by: Noah Wager --- drivers/pci/of.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 48ba95e4ab05..efb9952274fc 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -470,9 +470,17 @@ static int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args * */ dn = pci_device_to_OF_node(pdev); if (dn) { - rc = of_irq_parse_one(dn, 0, out_irq); - if (!rc) - return rc; + int index; + + index = of_property_match_string(dn, "interrupt-names", "pci"); + if (index == -EINVAL) /* Property doesn't exist */ + index = 0; + + if (index >= 0) { + rc = of_irq_parse_one(dn, index, out_irq); + if (!rc) + return rc; + } } /*