aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/probe.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 6a0a82f0508b..9392ff3fb803 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -398,6 +398,16 @@ static void pci_enable_crs(struct pci_dev *dev)
398 pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl); 398 pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl);
399} 399}
400 400
401static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
402{
403 struct pci_bus *parent = child->parent;
404 while (parent->parent && parent->subordinate < max) {
405 parent->subordinate = max;
406 pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max);
407 parent = parent->parent;
408 }
409}
410
401unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus); 411unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
402 412
403/* 413/*
@@ -499,7 +509,13 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
499 509
500 if (!is_cardbus) { 510 if (!is_cardbus) {
501 child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA; 511 child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA;
502 512 /*
513 * Adjust subordinate busnr in parent buses.
514 * We do this before scanning for children because
515 * some devices may not be detected if the bios
516 * was lazy.
517 */
518 pci_fixup_parent_subordinate_busnr(child, max);
503 /* Now we can scan all subordinate buses... */ 519 /* Now we can scan all subordinate buses... */
504 max = pci_scan_child_bus(child); 520 max = pci_scan_child_bus(child);
505 } else { 521 } else {
@@ -513,6 +529,7 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
513 max+i+1)) 529 max+i+1))
514 break; 530 break;
515 max += i; 531 max += i;
532 pci_fixup_parent_subordinate_busnr(child, max);
516 } 533 }
517 /* 534 /*
518 * Set the subordinate bus number to its real value. 535 * Set the subordinate bus number to its real value.