Patchwork "multifunc-device": fix IRQ assignment by also scanning dummy nodes

login
register
mail settings
Submitter Tom Arbuckle
Date Feb. 11, 2009, 8:41 p.m.
Message ID <op.uo7fryg3fq1scd@kams>
Download mbox | patch
Permalink /patch/22933/
State Accepted, archived
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Tom Arbuckle - Feb. 11, 2009, 8:41 p.m.
Hello, Ben.


I've regenerated this patch against 2.6.28.4.

Patch

--- linux-2.6.28.4/arch/powerpc/kernel/pci_32.c.orig    2009-02-06 21:47:45.000000000 +0000
+++ linux-2.6.28.4/arch/powerpc/kernel/pci_32.c 2009-02-07 16:37:04.000000000 +0000
@@ -226,15 +226,21 @@  static struct device_node *scan_OF_for_p
                                               unsigned int devfn)
 {
        struct device_node *np;
+       struct device_node *np_sub = NULL;
        const u32 *reg;
        unsigned int psize;
 
        for_each_child_of_node(parent, np) {
                reg = of_get_property(np, "reg", &psize);
-               if (reg == NULL || psize < 4)
-                       continue;
-               if (((reg[0] >> 8) & 0xff) == devfn)
-                       return np;
+               if (reg && psize >= 4) {
+                       if (((reg[0] >> 8) & 0xff) == devfn)
+                               return np;
+               }
+               if (!strcmp(np->name, "multifunc-device")) {
+                       np_sub = scan_OF_for_pci_dev(np, devfn);
+                       if (np_sub)
+                               return np_sub;
+               }
        }
        return NULL;
 }