diff options
| author | Andrew Morton <akpm@osdl.org> | 2003-07-04 19:35:49 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-07-04 19:35:49 -0700 |
| commit | d8d90b60f9f123dbee861e7145e7ba508214b528 (patch) | |
| tree | 92c89b10866fd037fb91628e9540093f5b668ea3 | |
| parent | b40585d08dba9fcc7ca4b2b0d5dd888ce33c8742 (diff) | |
[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.
| -rw-r--r-- | drivers/pci/probe.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index af83b3936f6f..ccd50ca202f8 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -637,12 +637,6 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, { 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(); if (!b) return NULL; @@ -656,6 +650,14 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, b->sysdata = sysdata; 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); memset(b->dev,0,sizeof(*(b->dev))); |
