aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2013-12-23 07:46:05 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-02-10 19:24:51 -0500
commit1507589787529b0d8e2a9e66e0c6f113ecab5181 (patch)
tree69c63b49738951c8403809d3b0edf7b84e745792 /arch
parent730efb6193f8568354fd80849612291afa9fa81e (diff)
powerpc/xmon: Fix timeout loop in get_output_lock()
As far as I can tell, our 70s era timeout loop in get_output_lock() is generating no code. This leads to the hostile takeover happening more or less simultaneously on all cpus. The result is "interesting", some example output that is more readable than most: cpu 0x1: Vector: 100 (Scypsut e0mx bR:e setV)e catto xc0p:u[ c 00 c0:0 000t0o0V0erc0td:o5 rfc28050000]0c00 0 0 0 6t(pSrycsV1ppuot uxe 1m 2 0Rx21e3:0s0ce000c00000t00)00 60602oV2SerucSayt0y 0p 1sxs Fix it by using udelay() in the timeout loop. The wait time and check frequency are arbitrary, but seem to work OK. We already rely on udelay() working so this is not a new dependency. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/xmon/xmon.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 598cdc7c7adc..d712b23974ec 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -315,10 +315,17 @@ static void get_output_lock(void)
315 if (last_speaker == 0) 315 if (last_speaker == 0)
316 return; 316 return;
317 317
318 timeout = 10000000; 318 /*
319 * Wait a full second for the lock, we might be on a slow
320 * console, but check every 100us.
321 */
322 timeout = 10000;
319 while (xmon_speaker == last_speaker) { 323 while (xmon_speaker == last_speaker) {
320 if (--timeout > 0) 324 if (--timeout > 0) {
325 udelay(100);
321 continue; 326 continue;
327 }
328
322 /* hostile takeover */ 329 /* hostile takeover */
323 prev = cmpxchg(&xmon_speaker, last_speaker, me); 330 prev = cmpxchg(&xmon_speaker, last_speaker, me);
324 if (prev == last_speaker) 331 if (prev == last_speaker)