aboutsummaryrefslogtreecommitdiff
path: root/core/pci.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2015-02-18 14:57:29 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-02-18 15:41:30 +1100
commit12054b6a6911ad559b8cb4c59f17c30410569235 (patch)
tree7f72cea426d81b54a175e849b705e4d288df29e0 /core/pci.c
parent789c171a6783918783855eb195a9502dfe3791ba (diff)
downloadskiboot-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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/pci.c b/core/pci.c
index 693ec21..a75709a 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -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 */