Skip to content

Commit 9ee56b5

Browse files
Hari Bathinistewartsmith
authored andcommitted
cpu: Fix hang issue in opal_reinit_cpus()
Commit 87690bd 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>
1 parent 9ea274e commit 9ee56b5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/cpu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,6 @@ static int64_t opal_reinit_cpus(uint64_t flags)
644644

645645
prerror("OPAL: Trying a CPU re-init with flags: 0x%llx\n", flags);
646646

647-
again:
648647
lock(&reinit_lock);
649648

650649
for (cpu = first_cpu(); cpu; cpu = next_cpu(cpu)) {
@@ -659,7 +658,7 @@ static int64_t opal_reinit_cpus(uint64_t flags)
659658
(cpu->state == cpu_state_os); i++) {
660659
unlock(&reinit_lock);
661660
time_wait_ms(1);
662-
goto again;
661+
lock(&reinit_lock);
663662
}
664663
if (cpu->state == cpu_state_os) {
665664
prerror("OPAL: CPU 0x%x not in OPAL !\n", cpu->pir);

0 commit comments

Comments
 (0)