Skip to content

Commit 580911c

Browse files
Hongchen ZhangKexyBiscuit
authored andcommitted
FROMLIST: PCI: Use local_pci_probe() when best selected cpu is offline
When the best selected CPU is offline, work_on_cpu() will stuck forever. This can be happen if a node is online while all its CPUs are offline (we can use "maxcpus=1" without "nr_cpus=1" to reproduce it), Therefore, in this case, we should call local_pci_probe() instead of work_on_cpu(). Cc: [email protected] Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Hongchen Zhang <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Kexy Biscuit <[email protected]>
1 parent 586ea0e commit 580911c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/pci-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
386386
free_cpumask_var(wq_domain_mask);
387387
}
388388

389-
if (cpu < nr_cpu_ids)
389+
if ((cpu < nr_cpu_ids) && cpu_online(cpu))
390390
error = work_on_cpu(cpu, local_pci_probe, &ddi);
391391
else
392392
error = local_pci_probe(&ddi);

0 commit comments

Comments
 (0)