Commit 26f674ae authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[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: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ef6689ef
...@@ -398,6 +398,16 @@ static void pci_enable_crs(struct pci_dev *dev) ...@@ -398,6 +398,16 @@ static void pci_enable_crs(struct pci_dev *dev)
pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl); pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl);
} }
static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
{
struct pci_bus *parent = child->parent;
while (parent->parent && parent->subordinate < max) {
parent->subordinate = max;
pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max);
parent = parent->parent;
}
}
unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus); unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
/* /*
...@@ -499,7 +509,13 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max ...@@ -499,7 +509,13 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
if (!is_cardbus) { if (!is_cardbus) {
child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA; child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA;
/*
* Adjust subordinate busnr in parent buses.
* We do this before scanning for children because
* some devices may not be detected if the bios
* was lazy.
*/
pci_fixup_parent_subordinate_busnr(child, max);
/* Now we can scan all subordinate buses... */ /* Now we can scan all subordinate buses... */
max = pci_scan_child_bus(child); max = pci_scan_child_bus(child);
} else { } else {
...@@ -513,6 +529,7 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max ...@@ -513,6 +529,7 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
max+i+1)) max+i+1))
break; break;
max += i; max += i;
pci_fixup_parent_subordinate_busnr(child, max);
} }
/* /*
* Set the subordinate bus number to its real value. * Set the subordinate bus number to its real value.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment