[Skiboot] [PATCH] cpu: Fix hang issue in opal_reinit_cpus()

Hari Bathini hbathini at linux.vnet.ibm.com
Thu Jun 11 21:07:49 AEST 2015

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 at linux.vnet.ibm.com>
 core/cpu.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/core/cpu.c b/core/cpu.c
index 6812ff0..cdf84ac 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -695,7 +695,6 @@ static int64_t opal_reinit_cpus(uint64_t flags)
 	prerror("OPAL: Trying a CPU re-init with flags: 0x%llx\n", flags);
- again:
 	for (cpu = first_cpu(); cpu; cpu = next_cpu(cpu)) {
@@ -710,7 +709,7 @@ static int64_t opal_reinit_cpus(uint64_t flags)
 				     (cpu->state == cpu_state_os); i++) {
-				goto again;
+				lock(&reinit_lock);
 			if (cpu->state == cpu_state_os) {
 				prerror("OPAL: CPU 0x%x not in OPAL !\n", cpu->pir);

More information about the Skiboot mailing list