]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] Workaround oldworld OF bug with IRQs & P2P bridges
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 14 Dec 2006 20:13:26 +0000 (07:13 +1100)
committerPaul Mackerras <paulus@samba.org>
Wed, 20 Dec 2006 05:37:47 +0000 (16:37 +1100)
On some oldworld PowerMacs, OF doesn't assign interrupts properly
beyond P2P bridges. Fortunately, the fix is easy as all those machines
just wire all IRQ lines together to one IRQ which is assigned to the
bridge itself. We already have a special function for parsing Apple
OldWorld interrupts which are special, so let's add to it the ability
to walk up the PCI tree to find interrupts.

This fixes irqs on the lower slots of s900 clones among others.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/prom_parse.c

index 0dfbe1cd28eb2644cd59927eae4938fa8fdf088a..12c51e4ad2b4b97b4468e8fca178fa435d86a025 100644 (file)
@@ -920,9 +920,20 @@ static int of_irq_map_oldworld(struct device_node *device, int index,
 
        /*
         * Old machines just have a list of interrupt numbers
-        * and no interrupt-controller nodes.
+        * and no interrupt-controller nodes. We also have dodgy
+        * cases where the APPL,interrupts property is completely
+        * missing behind pci-pci bridges and we have to get it
+        * from the parent (the bridge itself, as apple just wired
+        * everything together on these)
         */
-       ints = get_property(device, "AAPL,interrupts", &intlen);
+       while (device) {
+               ints = get_property(device, "AAPL,interrupts", &intlen);
+               if (ints != NULL)
+                       break;
+               device = device->parent;
+               if (device && strcmp(device->type, "pci") != 0)
+                       break;
+       }
        if (ints == NULL)
                return -EINVAL;
        intlen /= sizeof(u32);