Commit 2cc7345f authored by David S. Miller's avatar David S. Miller

[SPARC64]: Fix booting on V100 systems.

On the root PCI bus, the OBP device tree lists device 3 twice.
Once as 'pm' and once as 'lomp'.

Everything goes downhill from there.

Ignore the second instance to workaround this.

Thanks to Kövedi_Krisztián for the bug report and
testing the fix.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 577107e8
...@@ -744,7 +744,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, ...@@ -744,7 +744,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
{ {
struct device_node *child; struct device_node *child;
const u32 *reg; const u32 *reg;
int reglen, devfn; int reglen, devfn, prev_devfn;
struct pci_dev *dev; struct pci_dev *dev;
if (ofpci_verbose) if (ofpci_verbose)
...@@ -752,14 +752,25 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, ...@@ -752,14 +752,25 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
node->full_name, bus->number); node->full_name, bus->number);
child = NULL; child = NULL;
prev_devfn = -1;
while ((child = of_get_next_child(node, child)) != NULL) { while ((child = of_get_next_child(node, child)) != NULL) {
if (ofpci_verbose) if (ofpci_verbose)
printk(" * %s\n", child->full_name); printk(" * %s\n", child->full_name);
reg = of_get_property(child, "reg", &reglen); reg = of_get_property(child, "reg", &reglen);
if (reg == NULL || reglen < 20) if (reg == NULL || reglen < 20)
continue; continue;
devfn = (reg[0] >> 8) & 0xff; 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 */ /* create a new pci_dev for this device */
dev = of_create_pci_dev(pbm, child, bus, devfn, 0); dev = of_create_pci_dev(pbm, child, bus, devfn, 0);
if (!dev) if (!dev)
......
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