Commit d8d90b60 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] PCI domain scanning fix

From: Matthew Wilcox <willy@debian.org>

ppc64 oopses on boot because pci_scan_bus_parented() is unexpectedly
returning NULL.  Change pci_scan_bus_parented() to correctly handle
overlapping PCI bus numbers on different domains.
parent b40585d0
...@@ -637,12 +637,6 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, ...@@ -637,12 +637,6 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus,
{ {
struct pci_bus *b; struct pci_bus *b;
if (pci_find_bus(0, bus)) {
/* If we already got to this bus through a different bridge, ignore it */
DBG("PCI: Bus %02x already known\n", bus);
return NULL;
}
b = pci_alloc_bus(); b = pci_alloc_bus();
if (!b) if (!b)
return NULL; return NULL;
...@@ -656,6 +650,14 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, ...@@ -656,6 +650,14 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus,
b->sysdata = sysdata; b->sysdata = sysdata;
b->ops = ops; b->ops = ops;
if (pci_find_bus(pci_domain_nr(b), bus)) {
/* If we already got to this bus through a different bridge, ignore it */
DBG("PCI: Bus %02x already known\n", bus);
kfree(b->dev);
kfree(b);
return NULL;
}
list_add_tail(&b->node, &pci_root_buses); list_add_tail(&b->node, &pci_root_buses);
memset(b->dev,0,sizeof(*(b->dev))); memset(b->dev,0,sizeof(*(b->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