aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-07-06 18:35:18 -0400
committerTony Luck <tony.luck@intel.com>2005-07-06 18:35:18 -0400
commit67d340f440f389e9d56201fb7c7aaa92f262feb1 (patch)
treea96c26a370beb23282a561ddd936e5d0aa93adde /drivers/pci/probe.c
parent2ba3e3e65cf182436757ba13ea8d564e2950fb56 (diff)
parent159f597a8bd0f1d7650d5e580c93a2666c9c26d1 (diff)
Auto merge with /home/aegl/GIT/linus
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 6a0a82f0508b..df3bdae2040f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -239,9 +239,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
239 239
240 if (dev->transparent) { 240 if (dev->transparent) {
241 printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); 241 printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev));
242 for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++) 242 for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++)
243 child->resource[i] = child->parent->resource[i]; 243 child->resource[i] = child->parent->resource[i - 3];
244 return;
245 } 244 }
246 245
247 for(i=0; i<3; i++) 246 for(i=0; i<3; i++)
@@ -398,6 +397,16 @@ static void pci_enable_crs(struct pci_dev *dev)
398 pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl); 397 pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl);
399} 398}
400 399
400static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
401{
402 struct pci_bus *parent = child->parent;
403 while (parent->parent && parent->subordinate < max) {
404 parent->subordinate = max;
405 pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max);
406 parent = parent->parent;
407 }
408}
409
401unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus); 410unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
402 411
403/* 412/*
@@ -499,7 +508,13 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
499 508
500 if (!is_cardbus) { 509 if (!is_cardbus) {
501 child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA; 510 child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA;
502 511 /*
512 * Adjust subordinate busnr in parent buses.
513 * We do this before scanning for children because
514 * some devices may not be detected if the bios
515 * was lazy.
516 */
517 pci_fixup_parent_subordinate_busnr(child, max);
503 /* Now we can scan all subordinate buses... */ 518 /* Now we can scan all subordinate buses... */
504 max = pci_scan_child_bus(child); 519 max = pci_scan_child_bus(child);
505 } else { 520 } else {
@@ -513,6 +528,7 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
513 max+i+1)) 528 max+i+1))
514 break; 529 break;
515 max += i; 530 max += i;
531 pci_fixup_parent_subordinate_busnr(child, max);
516 } 532 }
517 /* 533 /*
518 * Set the subordinate bus number to its real value. 534 * Set the subordinate bus number to its real value.