Skip to content

Commit 5799eba

Browse files
author
Bartosz Golaszewski
committed
PCI: Hold the rescan mutex when scanning for the first time
With the introduction of PCI device power control drivers that will be able to trigger the port rescan when probing, we need to hold the rescan mutex during the initial pci_host_probe() too or the two could get in each other's way. Tested-by: Amit Pundir <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD, SM8650-QRD & SM8650-HDK Tested-by: Caleb Connolly <[email protected]> # OnePlus 8T Acked-by: Bjorn Helgaas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 2f1630f commit 5799eba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/pci/probe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3069,7 +3069,9 @@ int pci_host_probe(struct pci_host_bridge *bridge)
30693069
struct pci_bus *bus, *child;
30703070
int ret;
30713071

3072+
pci_lock_rescan_remove();
30723073
ret = pci_scan_root_bus_bridge(bridge);
3074+
pci_unlock_rescan_remove();
30733075
if (ret < 0) {
30743076
dev_err(bridge->dev.parent, "Scanning root bridge failed");
30753077
return ret;

0 commit comments

Comments
 (0)