diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2010-02-23 12:24:36 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-02-23 12:43:37 -0500 |
commit | 2fe2abf896c1e7a0ee65faaf3ef0ce654848abbd (patch) | |
tree | f066d5c94bbed5ca3556b4d2f0c4b3a9795b6eff /arch/ia64/pci | |
parent | 89a74ecccd1f78e51faf6287e5c0e93a92ac096e (diff) |
PCI: augment bus resource table with a list
Previously we used a table of size PCI_BUS_NUM_RESOURCES (16) for resources
forwarded to a bus by its upstream bridge. We've increased this size
several times when the table overflowed.
But there's no good limit on the number of resources because host bridges
and subtractive decode bridges can forward any number of ranges to their
secondary buses.
This patch reduces the table to only PCI_BRIDGE_RESOURCE_NUM (4) entries,
which corresponds to the number of windows a PCI-to-PCI (3) or CardBus (4)
bridge can positively decode. Any additional resources, e.g., PCI host
bridge windows or subtractively-decoded regions, are kept in a list.
I'd prefer a single list rather than this split table/list approach, but
that requires simultaneous changes to every architecture. This approach
only requires immediate changes where we set up (a) host bridges with more
than four windows and (b) subtractive-decode P2P bridges, and we can
incrementally change other architectures to use the list.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/ia64/pci')
-rw-r--r-- | arch/ia64/pci/pci.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 89f957ca3eb2..64aff520b899 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -320,9 +320,9 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data) | |||
320 | static void __devinit | 320 | static void __devinit |
321 | pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl) | 321 | pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl) |
322 | { | 322 | { |
323 | int i, j; | 323 | int i; |
324 | 324 | ||
325 | j = 0; | 325 | pci_bus_remove_resources(bus); |
326 | for (i = 0; i < ctrl->windows; i++) { | 326 | for (i = 0; i < ctrl->windows; i++) { |
327 | struct resource *res = &ctrl->window[i].resource; | 327 | struct resource *res = &ctrl->window[i].resource; |
328 | /* HP's firmware has a hack to work around a Windows bug. | 328 | /* HP's firmware has a hack to work around a Windows bug. |
@@ -330,13 +330,7 @@ pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl) | |||
330 | if ((res->flags & IORESOURCE_MEM) && | 330 | if ((res->flags & IORESOURCE_MEM) && |
331 | (res->end - res->start < 16)) | 331 | (res->end - res->start < 16)) |
332 | continue; | 332 | continue; |
333 | if (j >= PCI_BUS_NUM_RESOURCES) { | 333 | pci_bus_add_resource(bus, res, 0); |
334 | dev_warn(&bus->dev, | ||
335 | "ignoring host bridge window %pR (no space)\n", | ||
336 | res); | ||
337 | continue; | ||
338 | } | ||
339 | bus->resource[j++] = res; | ||
340 | } | 334 | } |
341 | } | 335 | } |
342 | 336 | ||