Commit 2d96ae6b authored by Andrew Morton's avatar Andrew Morton Committed by Ingo Molnar

arch/x86/pci/irq.c: attempt to clean up code layout

Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 27990eac
...@@ -1041,37 +1041,46 @@ static void __init pcibios_fixup_irqs(void) ...@@ -1041,37 +1041,46 @@ static void __init pcibios_fixup_irqs(void)
if (io_apic_assign_pci_irqs) { if (io_apic_assign_pci_irqs) {
int irq; int irq;
if (pin) { if (!pin)
continue;
/* /*
* interrupt pins are numbered starting * interrupt pins are numbered starting from 1
* from 1
*/ */
pin--; pin--;
irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
PCI_SLOT(dev->devfn), pin); PCI_SLOT(dev->devfn), pin);
/* /*
* Busses behind bridges are typically not listed in the MP-table. * Busses behind bridges are typically not listed in the
* In this case we have to look up the IRQ based on the parent bus, * MP-table. In this case we have to look up the IRQ
* parent slot, and pin number. The SMP code detects such bridged * based on the parent bus, parent slot, and pin number.
* busses itself so we should get into this branch reliably. * The SMP code detects such bridged busses itself so we
* should get into this branch reliably.
*/ */
if (irq < 0 && dev->bus->parent) { /* go back to the bridge */ if (irq < 0 && dev->bus->parent) {
/* go back to the bridge */
struct pci_dev *bridge = dev->bus->self; struct pci_dev *bridge = dev->bus->self;
int bus;
pin = (pin + PCI_SLOT(dev->devfn)) % 4; pin = (pin + PCI_SLOT(dev->devfn)) % 4;
irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, bus = bridge->bus->number;
irq = IO_APIC_get_PCI_irq_vector(bus,
PCI_SLOT(bridge->devfn), pin); PCI_SLOT(bridge->devfn), pin);
if (irq >= 0) if (irq >= 0)
dev_warn(&dev->dev, "using bridge %s INT %c to get IRQ %d\n", dev_warn(&dev->dev,
"using bridge %s INT %c to "
"get IRQ %d\n",
pci_name(bridge), pci_name(bridge),
'A' + pin, irq); 'A' + pin, irq);
} }
if (irq >= 0) { if (irq >= 0) {
dev_info(&dev->dev, "PCI->APIC IRQ transform: INT %c -> IRQ %d\n", 'A' + pin, irq); dev_info(&dev->dev,
"PCI->APIC IRQ transform: INT %c "
"-> IRQ %d\n",
'A' + pin, irq);
dev->irq = irq; dev->irq = irq;
} }
} }
}
#endif #endif
/* /*
* Still no IRQ? Try to lookup one... * Still no IRQ? Try to lookup one...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment