Skip to content

Commit 49ad31e

Browse files
westeribjorn-helgaas
authored andcommitted
PCI: Pass available buses even if the bridge is already configured
If some part of the PCI topology is already configured (by the boot firmware) but not all, and it includes hotplug bridges, we may need to extend the bus resources of those bridges to accommodate any future hotplugs, in the same way we already do with the normal hotplug case. Pass the available buses to pci_scan_child_bus_extend() even when the bridge in question is already configured so the bus allocation code can use these available buses to extend the possible hotplug bridges below. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216000 Link: https://lore.kernel.org/r/20220905080232.36087-3-mika.westerberg@linux.intel.com Reported-by: Chris Chiu <chris.chiu@canonical.com> Tested-by: Chris Chiu <chris.chiu@canonical.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 8066cc8 commit 49ad31e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/pci/probe.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev,
12971297

12981298
if ((secondary || subordinate) && !pcibios_assign_all_busses() &&
12991299
!is_cardbus && !broken) {
1300-
unsigned int cmax;
1300+
unsigned int cmax, buses;
13011301

13021302
/*
13031303
* Bus already configured by firmware, process it in the
@@ -1322,7 +1322,8 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev,
13221322
child->bridge_ctl = bctl;
13231323
}
13241324

1325-
cmax = pci_scan_child_bus(child);
1325+
buses = subordinate - secondary;
1326+
cmax = pci_scan_child_bus_extend(child, buses);
13261327
if (cmax > subordinate)
13271328
pci_warn(dev, "bridge has subordinate %02x but max busn %02x\n",
13281329
subordinate, cmax);

0 commit comments

Comments
 (0)