aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/pci/pci.c
diff options
context:
space:
mode:
authorRajesh Shah <rajesh.shah@intel.com>2005-04-28 03:25:45 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-28 00:52:39 -0400
commitfab3fb0ac8c83072465b28ca859c420da6c6511c (patch)
treef4d0dc0b7e9a8bd3611e1bf7f64dfd3cb55a950c /arch/ia64/pci/pci.c
parentc431ada45d65b305a6aab4557067e564b23ce5a5 (diff)
[PATCH] acpi bridge hotadd: Fix pci_enable_device() for p2p bridges
When checking if a PCI to PCI bridge should be enabled to decode memory and/or IO resources, we need to look at all device resources not just the first 6. This is needed to allow PCI bridges to pass down memory and IO accesses to child devices even when the bridge itself does not consume resources in its PCI BARs. Signed-off-by: Rajesh Shah <rajesh.shah@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/ia64/pci/pci.c')
-rw-r--r--arch/ia64/pci/pci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index c0661d3382e4..2a1487758490 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -418,18 +418,24 @@ pcibios_enable_resources (struct pci_dev *dev, int mask)
418 u16 cmd, old_cmd; 418 u16 cmd, old_cmd;
419 int idx; 419 int idx;
420 struct resource *r; 420 struct resource *r;
421 unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM;
421 422
422 if (!dev) 423 if (!dev)
423 return -EINVAL; 424 return -EINVAL;
424 425
425 pci_read_config_word(dev, PCI_COMMAND, &cmd); 426 pci_read_config_word(dev, PCI_COMMAND, &cmd);
426 old_cmd = cmd; 427 old_cmd = cmd;
427 for (idx=0; idx<6; idx++) { 428 for (idx=0; idx<PCI_NUM_RESOURCES; idx++) {
428 /* Only set up the desired resources. */ 429 /* Only set up the desired resources. */
429 if (!(mask & (1 << idx))) 430 if (!(mask & (1 << idx)))
430 continue; 431 continue;
431 432
432 r = &dev->resource[idx]; 433 r = &dev->resource[idx];
434 if (!(r->flags & type_mask))
435 continue;
436 if ((idx == PCI_ROM_RESOURCE) &&
437 (!(r->flags & IORESOURCE_ROM_ENABLE)))
438 continue;
433 if (!r->start && r->end) { 439 if (!r->start && r->end) {
434 printk(KERN_ERR 440 printk(KERN_ERR
435 "PCI: Device %s not available because of resource collisions\n", 441 "PCI: Device %s not available because of resource collisions\n",
@@ -441,8 +447,6 @@ pcibios_enable_resources (struct pci_dev *dev, int mask)
441 if (r->flags & IORESOURCE_MEM) 447 if (r->flags & IORESOURCE_MEM)
442 cmd |= PCI_COMMAND_MEMORY; 448 cmd |= PCI_COMMAND_MEMORY;
443 } 449 }
444 if (dev->resource[PCI_ROM_RESOURCE].start)
445 cmd |= PCI_COMMAND_MEMORY;
446 if (cmd != old_cmd) { 450 if (cmd != old_cmd) {
447 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); 451 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
448 pci_write_config_word(dev, PCI_COMMAND, cmd); 452 pci_write_config_word(dev, PCI_COMMAND, cmd);