diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-02-18 14:57:29 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-02-18 15:41:30 +1100 |
commit | 12054b6a6911ad559b8cb4c59f17c30410569235 (patch) | |
tree | 7f72cea426d81b54a175e849b705e4d288df29e0 /core/pci.c | |
parent | 789c171a6783918783855eb195a9502dfe3791ba (diff) | |
download | skiboot-12054b6a6911ad559b8cb4c59f17c30410569235.zip skiboot-12054b6a6911ad559b8cb4c59f17c30410569235.tar.gz skiboot-12054b6a6911ad559b8cb4c59f17c30410569235.tar.bz2 |
pci: Don't hang if we have only one CPU
The job dispatch code would spin forever trying to find a target
CPU on a machine with only one available
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/pci.c')
-rw-r--r-- | core/pci.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1405,6 +1405,13 @@ static void pci_do_jobs(void (*fn)(void *)) cpu = next_available_cpu(cpu); if (!cpu) cpu = first_available_cpu(); + + /* No CPU to run on, just run synchro */ + if (cpu == this_cpu()) { + fn(phbs[i]); + jobs[i] = NULL; + goto next_phb; + } } jobs[i] = __cpu_queue_job(cpu, fn, phbs[i], false); @@ -1414,6 +1421,8 @@ static void pci_do_jobs(void (*fn)(void *)) cpu = next_available_cpu(cpu); if (!cpu) cpu = first_available_cpu(); + next_phb: + ; } /* Wait until all tasks are done */ |