Skip to content

Commit

Permalink
powerpc/watchdog: Fix final-check recovered case
Browse files Browse the repository at this point in the history
When the watchdog decides to panic, it takes the lock and double
checks everything (to avoid races with the CPU being unstuck or
panic()ed by something else).

The exit label was misplaced and would result in all-CPUs backtrace
and watchdog panic even in the case that the condition was found to be
resolved.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Aug 9, 2017
1 parent 26c5c6e commit 8e23692
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/powerpc/kernel/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ static void watchdog_smp_panic(int cpu, u64 tb)
for_each_cpu(c, &wd_smp_cpus_pending)
set_cpu_stuck(c, tb);

out:
wd_smp_unlock(&flags);

printk_safe_flush();
Expand All @@ -157,6 +156,11 @@ static void watchdog_smp_panic(int cpu, u64 tb)

if (hardlockup_panic)
nmi_panic(NULL, "Hard LOCKUP");

return;

out:
wd_smp_unlock(&flags);
}

static void wd_smp_clear_cpu_pending(int cpu, u64 tb)
Expand Down

0 comments on commit 8e23692

Please sign in to comment.