diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-02 18:41:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-07-01 16:35:49 -0400 |
commit | 26f674ae0e37190bf61c988e52911e4372fdb5f5 (patch) | |
tree | 625b05e5edd627a5cce0289e78057ca5ccf2290c /drivers/pci/probe.c | |
parent | ef6689eff4b58273fed9e54293a3da983b321e9a (diff) |
[PATCH] PCI: Fix up PCI routing in parent bridge
When the cardbus bridge is behind another bridge change the routing
in the parent bridge for new cards. This fixes Cardbus on various AMD64
laptops.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 19 |
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 | ||
401 | static 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 | |||
401 | unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus); | 411 | unsigned 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. |