diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-01-15 23:45:23 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-01-16 18:30:10 -0500 |
commit | 7b9c8ba2d634a0467a8a36018a28624563f34f47 (patch) | |
tree | f973b2dffd95904843a060e5fc35bf5451f3ca74 /arch/ia64 | |
parent | 1681b8e1588f9119899e422181f728b197b1fe34 (diff) |
[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: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/pci/pci.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 30dbc98bf0b3..d27ecdcb6fca 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -454,14 +454,13 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx) | |||
454 | return 0; | 454 | return 0; |
455 | } | 455 | } |
456 | 456 | ||
457 | static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) | 457 | static void __devinit |
458 | pcibios_fixup_resources(struct pci_dev *dev, int start, int limit) | ||
458 | { | 459 | { |
459 | struct pci_bus_region region; | 460 | struct pci_bus_region region; |
460 | int i; | 461 | int i; |
461 | int limit = (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) ? \ | ||
462 | PCI_BRIDGE_RESOURCES : PCI_NUM_RESOURCES; | ||
463 | 462 | ||
464 | for (i = 0; i < limit; i++) { | 463 | for (i = start; i < limit; i++) { |
465 | if (!dev->resource[i].flags) | 464 | if (!dev->resource[i].flags) |
466 | continue; | 465 | continue; |
467 | region.start = dev->resource[i].start; | 466 | region.start = dev->resource[i].start; |
@@ -472,6 +471,16 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) | |||
472 | } | 471 | } |
473 | } | 472 | } |
474 | 473 | ||
474 | static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) | ||
475 | { | ||
476 | pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES); | ||
477 | } | ||
478 | |||
479 | static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev) | ||
480 | { | ||
481 | pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES); | ||
482 | } | ||
483 | |||
475 | /* | 484 | /* |
476 | * Called after each bus is probed, but before its children are examined. | 485 | * Called after each bus is probed, but before its children are examined. |
477 | */ | 486 | */ |
@@ -482,7 +491,7 @@ pcibios_fixup_bus (struct pci_bus *b) | |||
482 | 491 | ||
483 | if (b->self) { | 492 | if (b->self) { |
484 | pci_read_bridge_bases(b); | 493 | pci_read_bridge_bases(b); |
485 | pcibios_fixup_device_resources(b->self); | 494 | pcibios_fixup_bridge_resources(b->self); |
486 | } | 495 | } |
487 | list_for_each_entry(dev, &b->devices, bus_list) | 496 | list_for_each_entry(dev, &b->devices, bus_list) |
488 | pcibios_fixup_device_resources(dev); | 497 | pcibios_fixup_device_resources(dev); |