diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-12 07:59:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-12 07:59:49 -0700 |
commit | 040a2b6b596f51b0646c9631e29e73559341d5d3 (patch) | |
tree | 98f521dd931470345f446b6f6976f19a72d11ccf | |
parent | 532df780a2012ad75b3f078647f229c4dabd99d1 (diff) | |
parent | 2cc7345ff71b27b5ac99e49ad7de39360042f601 (diff) | |
download | talos-obmc-linux-040a2b6b596f51b0646c9631e29e73559341d5d3.tar.gz talos-obmc-linux-040a2b6b596f51b0646c9631e29e73559341d5d3.zip |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Fix booting on V100 systems.
-rw-r--r-- | arch/sparc64/kernel/pci.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 139b4cff8019..e8dac81d8a0d 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c @@ -744,7 +744,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, { struct device_node *child; const u32 *reg; - int reglen, devfn; + int reglen, devfn, prev_devfn; struct pci_dev *dev; if (ofpci_verbose) @@ -752,14 +752,25 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, node->full_name, bus->number); child = NULL; + prev_devfn = -1; while ((child = of_get_next_child(node, child)) != NULL) { if (ofpci_verbose) printk(" * %s\n", child->full_name); reg = of_get_property(child, "reg", ®len); if (reg == NULL || reglen < 20) continue; + devfn = (reg[0] >> 8) & 0xff; + /* This is a workaround for some device trees + * which list PCI devices twice. On the V100 + * for example, device number 3 is listed twice. + * Once as "pm" and once again as "lomp". + */ + if (devfn == prev_devfn) + continue; + prev_devfn = devfn; + /* create a new pci_dev for this device */ dev = of_create_pci_dev(pbm, child, bus, devfn, 0); if (!dev) |