diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-09-29 13:29:40 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-10-04 11:26:23 +1100 |
commit | 064996d62a33ffe10264b5af5dca92d54f60f806 (patch) | |
tree | b1a8280f35dc949c35e4ac0864a52db688c12b20 /arch/powerpc/xmon/xmon.c | |
parent | 80e4d70b06863e0104e5a0dc78aa3710297fbd4b (diff) | |
download | talos-obmc-linux-064996d62a33ffe10264b5af5dca92d54f60f806.tar.gz talos-obmc-linux-064996d62a33ffe10264b5af5dca92d54f60f806.zip |
powerpc/xmon: Avoid tripping SMP hardlockup watchdog
The SMP hardlockup watchdog cross-checks other CPUs for lockups, which
causes xmon headaches because it's assuming interrupts hard disabled
means no watchdog troubles. Try to improve that by calling
touch_nmi_watchdog() in obvious places where secondaries are spinning.
Also annotate these spin loops with spin_begin/end calls.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/xmon/xmon.c')
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 33351c6704b1..d9a12102b111 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -530,14 +530,19 @@ static int xmon_core(struct pt_regs *regs, int fromipi) waiting: secondary = 1; + spin_begin(); while (secondary && !xmon_gate) { if (in_xmon == 0) { - if (fromipi) + if (fromipi) { + spin_end(); goto leave; + } secondary = test_and_set_bit(0, &in_xmon); } - barrier(); + spin_cpu_relax(); + touch_nmi_watchdog(); } + spin_end(); if (!secondary && !xmon_gate) { /* we are the first cpu to come in */ @@ -568,21 +573,25 @@ static int xmon_core(struct pt_regs *regs, int fromipi) mb(); xmon_gate = 1; barrier(); + touch_nmi_watchdog(); } cmdloop: while (in_xmon) { if (secondary) { + spin_begin(); if (cpu == xmon_owner) { if (!test_and_set_bit(0, &xmon_taken)) { secondary = 0; + spin_end(); continue; } /* missed it */ while (cpu == xmon_owner) - barrier(); + spin_cpu_relax(); } - barrier(); + spin_cpu_relax(); + touch_nmi_watchdog(); } else { cmd = cmds(regs); if (cmd != 0) { |