Skip to content

Commit

Permalink
[POWERPC] Fix PCI IRQ fallback code to not map IRQ 0
Browse files Browse the repository at this point in the history
The PCI IRQ code has a fallback when the device-tree parsing fails, that
tries to map the interrupt indicated by PCI_INTERRUPT_LINE if the firmware
set something in there. This is a bit fragile but has proven useful in some
cases so far. However, it's causing us to incorrectly try to map interrupt 0
on various setups, so let's prevent that case, as none of the cases where
the fallback is legit should have an IRQ 0.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Dec 20, 2007
1 parent 553aa76 commit 54a24cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
if (pin == 0)
return -1;
if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
line == 0xff) {
line == 0xff || line == 0) {
return -1;
}
DBG(" -> no map ! Using irq line %d from PCI config\n", line);
DBG(" -> no map ! Using line %d (pin %d) from PCI config\n",
line, pin);

virq = irq_create_mapping(NULL, line);
if (virq != NO_IRQ)
Expand Down

0 comments on commit 54a24cb

Please sign in to comment.