--- linux-2.4.21-106/drivers/acpi/pci_irq.c Tue Sep 30 07:14:55 2003 +++ pci_irq.c Mon Oct 20 17:22:34 2003 @@ -376,7 +376,7 @@ struct pci_dev *dev, int pin) { - struct pci_dev *bridge = dev; + struct pci_dev *curr = dev; int irq = 0; ACPI_FUNCTION_TRACE("acpi_pci_irq_derive"); @@ -388,11 +388,19 @@ * Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (a.k.a. the "bridge swizzle"). */ - while (!irq && bridge->bus->self) { - pin = (pin + PCI_SLOT(bridge->devfn)) % 4; - bridge = bridge->bus->self; - irq = acpi_pci_irq_lookup(0, bridge->bus->number, PCI_SLOT(bridge->devfn), pin); - } + do { + irq = acpi_pci_irq_lookup(0, curr->bus->number, PCI_SLOT(curr->devfn), pin); + + if (irq) break; + + /* + * Bridge swizzle step + */ + pin = (pin + PCI_SLOT(curr->devfn)) % 4; + curr = curr->bus->self; + + } while (curr); + if (!irq) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to derive IRQ for device %s\n", dev->slot_name)); @@ -433,15 +441,10 @@ /* * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot. - */ - irq = acpi_pci_irq_lookup(0, dev->bus->number, PCI_SLOT(dev->devfn), pin); - - /* * If no PRT entry was found, we'll try to derive an IRQ from the * device's parent bridge. */ - if (!irq) - irq = acpi_pci_irq_derive(dev, pin); + irq = acpi_pci_irq_derive(dev, pin); /* * No IRQ known to the ACPI subsystem - maybe the BIOS /