linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH kernel] powerpc/pci: Fix broken INTx configuration via OF
@ 2018-02-08  5:33 Alexey Kardashevskiy
  2018-02-08 19:20 ` Bjorn Helgaas
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alexey Kardashevskiy @ 2018-02-08  5:33 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Alexey Kardashevskiy, Benjamin Herrenschmidt, Bjorn Helgaas,
	Michael Ellerman, Paul Mackerras, Rob Herring, Alistair Popple

Commit 59f47eff03a0 ("powerpc/pci: Use of_irq_parse_and_map_pci() helper")
correctly states that of_irq_parse_and_map_pci() does the same thing as
of_irq_parse_pci() does as it simply calls
of_irq_parse_pci() and irq_create_of_mapping().

However of_irq_parse_and_map_pci() not only returns 0 for success and
negative value for an error but also a positive virq value from
irq_create_of_mapping() which the mentioned commit ignores and
INTx config fails.

This fixes the of_irq_parse_and_map_pci() return value handling.

Fixes: 59f47eff03a0 "powerpc/pci: Use of_irq_parse_and_map_pci() helper"
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

Found it on POWER9 + powernv system - almost all devices suddenly lost
INTx support.
---
 arch/powerpc/kernel/pci-common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index ae2ede4..acbb44f2 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -370,7 +370,8 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
 	memset(&oirq, 0xff, sizeof(oirq));
 #endif
 	/* Try to get a mapping from the device-tree */
-	if (!of_irq_parse_and_map_pci(pci_dev, 0, 0)) {
+	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
+	if (virq <= 0) {
 		u8 line, pin;
 
 		/* If that fails, lets fallback to what is in the config
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-09  5:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-08  5:33 [PATCH kernel] powerpc/pci: Fix broken INTx configuration via OF Alexey Kardashevskiy
2018-02-08 19:20 ` Bjorn Helgaas
2018-02-08 21:39   ` Bjorn Helgaas
2018-02-08 22:21     ` Benjamin Herrenschmidt
2018-02-08 22:42       ` Bjorn Helgaas
2018-02-08 22:50         ` Benjamin Herrenschmidt
2018-02-08 19:46 ` Rob Herring
2018-02-09  4:00 ` [kernel] " Michael Ellerman
2018-02-09  4:20   ` Alexey Kardashevskiy
2018-02-09  5:34     ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).