Skip to content

Commit 7a0b33d

Browse files
committed
Revert "PCI: Don't scan random busses in pci_scan_bridge()"
This reverts commit fc1b253 ("PCI: Don't scan random busses in pci_scan_bridge()") because it breaks CardBus on some machines. David tested a Dell Latitude D505 that worked like this prior to fc1b253: pci 0000:00:1e.0: PCI bridge to [bus 01] pci 0000:01:01.0: CardBus bridge to [bus 02-05] Note that the 01:01.0 CardBus bridge has a bus number aperture of [bus 02-05], but those buses are all outside the 00:1e.0 PCI bridge bus number aperture, so accesses to buses 02-05 never reach CardBus. This is later patched up by yenta_fixup_parent_bridge(), which changes the subordinate bus number of the 00:1e.0 PCI bridge: pci_bus 0000:01: Raising subordinate bus# of parent bus (#1) from #1 to #05 With fc1b253, pci_scan_bridge() fails immediately when it notices that we can't allocate a valid secondary bus number for the CardBus bridge, and CardBus doesn't work at all: pci 0000:01:01.0: can't allocate child bus 01 from [bus 01] I'd prefer to fix this by integrating the yenta_fixup_parent_bridge() logic into pci_scan_bridge() so we fix the bus number apertures up front. But I don't think we can do that before v3.17, so I'm going to revert this to avoid the problem while we're working on the long-term fix. Link: https://bugzilla.kernel.org/show_bug.cgi?id=83441 Link: http://lkml.kernel.org/r/[email protected] Reported-by: David Henningsson <[email protected]> Tested-by: David Henningsson <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> CC: [email protected] # v3.15+
1 parent 649ae75 commit 7a0b33d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/pci/probe.c

+3-7
Original file line numberDiff line numberDiff line change
@@ -838,16 +838,12 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
838838
goto out;
839839
}
840840

841-
if (max >= bus->busn_res.end) {
842-
dev_warn(&dev->dev, "can't allocate child bus %02x from %pR\n",
843-
max, &bus->busn_res);
844-
goto out;
845-
}
846-
847841
/* Clear errors */
848842
pci_write_config_word(dev, PCI_STATUS, 0xffff);
849843

850-
/* The bus will already exist if we are rescanning */
844+
/* Prevent assigning a bus number that already exists.
845+
* This can happen when a bridge is hot-plugged, so in
846+
* this case we only re-scan this bus. */
851847
child = pci_find_bus(pci_domain_nr(bus), max+1);
852848
if (!child) {
853849
child = pci_add_new_bus(bus, dev, max+1);

0 commit comments

Comments
 (0)