diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-27 15:48:44 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-11-05 17:26:05 -0500 |
commit | b5ae5f911d221ad85090d6805ab9ab020f6e4703 (patch) | |
tree | c3d9ff10fc1f8b6cd0984f908774c5ea4eeef333 /arch/powerpc | |
parent | 57b066ff4ec53a0ac7cbf7fb363bb670cf58ddae (diff) |
powerpc/pci: Make pcibios_allocate_bus_resources more robust
To properly fix PCI hotplug, it's useful to be able to make the fixup
passes on all devices whether they were just hot plugged or already
there.
However, pcibios_allocate_bus_resources() wouldn't cope well with
being called twice for a given bus. This makes it ignore resources
that have already been allocated, along with adding a bit of debug
output.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 0eaabd41474f..f965397a6105 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -1243,9 +1243,12 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus) | |||
1243 | int i; | 1243 | int i; |
1244 | struct resource *res, *pr; | 1244 | struct resource *res, *pr; |
1245 | 1245 | ||
1246 | pr_debug("PCI: Allocating bus resources for %04x:%02x...\n", | ||
1247 | pci_domain_nr(bus), bus->number); | ||
1248 | |||
1246 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { | 1249 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { |
1247 | if ((res = bus->resource[i]) == NULL || !res->flags | 1250 | if ((res = bus->resource[i]) == NULL || !res->flags |
1248 | || res->start > res->end) | 1251 | || res->start > res->end || res->parent) |
1249 | continue; | 1252 | continue; |
1250 | if (bus->parent == NULL) | 1253 | if (bus->parent == NULL) |
1251 | pr = (res->flags & IORESOURCE_IO) ? | 1254 | pr = (res->flags & IORESOURCE_IO) ? |