Commit 7b9c8ba2 authored by Kenji Kaneshige's avatar Kenji Kaneshige Committed by Tony Luck

[IA64] Stop multiple pci_claim_resource() call for the same resource

This patch fixes the bug that pci_claim_resource() is called multiple
times for the same P2P bridge's resource structures if P2P bridges
require their own PCI I/O resources.
Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 1681b8e1
...@@ -454,14 +454,13 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx) ...@@ -454,14 +454,13 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
return 0; return 0;
} }
static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) static void __devinit
pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
{ {
struct pci_bus_region region; struct pci_bus_region region;
int i; int i;
int limit = (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) ? \
PCI_BRIDGE_RESOURCES : PCI_NUM_RESOURCES;
for (i = 0; i < limit; i++) { for (i = start; i < limit; i++) {
if (!dev->resource[i].flags) if (!dev->resource[i].flags)
continue; continue;
region.start = dev->resource[i].start; region.start = dev->resource[i].start;
...@@ -472,6 +471,16 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) ...@@ -472,6 +471,16 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
} }
} }
static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
{
pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES);
}
static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev)
{
pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES);
}
/* /*
* Called after each bus is probed, but before its children are examined. * Called after each bus is probed, but before its children are examined.
*/ */
...@@ -482,7 +491,7 @@ pcibios_fixup_bus (struct pci_bus *b) ...@@ -482,7 +491,7 @@ pcibios_fixup_bus (struct pci_bus *b)
if (b->self) { if (b->self) {
pci_read_bridge_bases(b); pci_read_bridge_bases(b);
pcibios_fixup_device_resources(b->self); pcibios_fixup_bridge_resources(b->self);
} }
list_for_each_entry(dev, &b->devices, bus_list) list_for_each_entry(dev, &b->devices, bus_list)
pcibios_fixup_device_resources(dev); pcibios_fixup_device_resources(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