diff options
author | Hari Bathini <hbathini@linux.vnet.ibm.com> | 2015-06-11 16:37:49 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-16 16:32:19 +1000 |
commit | 9ee56b55077d1bfb3df478abf7e5371a47b1bcd1 (patch) | |
tree | 122228e1155d13a1051d4313a480f2e5dfe70b27 | |
parent | 9ea274ef840bc90fc6df40bf884325cdb565b689 (diff) | |
download | skiboot-9ee56b55077d1bfb3df478abf7e5371a47b1bcd1.zip skiboot-9ee56b55077d1bfb3df478abf7e5371a47b1bcd1.tar.gz skiboot-9ee56b55077d1bfb3df478abf7e5371a47b1bcd1.tar.bz2 |
cpu: Fix hang issue in opal_reinit_cpus()
Commit 87690bd19dbb introduced a label "again" so as to avoid holding
the lock while waiting. But this leads to hang in scenarios like kdump,
where 'cpu_state_os' will be the state for all offline cpus. Actaully,
the wait loop doesn't really take off with the goto statement in it.
This patch tries to fix this problem by removing the goto statement
and unlocking/locking within the wait loop instead.
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/cpu.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -644,7 +644,6 @@ static int64_t opal_reinit_cpus(uint64_t flags) prerror("OPAL: Trying a CPU re-init with flags: 0x%llx\n", flags); - again: lock(&reinit_lock); for (cpu = first_cpu(); cpu; cpu = next_cpu(cpu)) { @@ -659,7 +658,7 @@ static int64_t opal_reinit_cpus(uint64_t flags) (cpu->state == cpu_state_os); i++) { unlock(&reinit_lock); time_wait_ms(1); - goto again; + lock(&reinit_lock); } if (cpu->state == cpu_state_os) { prerror("OPAL: CPU 0x%x not in OPAL !\n", cpu->pir); |