[PATCH] Xmon bug fix for soft-reset

For soft reset during system hang, got an error "CPU did not take
control" for some CPUs even though they responded to soft-reset (called
SystemReset, die and called debugger - xmon). First these CPUs entered
into xmon by IPI callback and then got a soft-reset exception and
re-entered into xmon again. The first CPU which re-entered into xmon got
the output lock and made into xmon successfully without unlocking.
Hence, the next CPU(s) which re-entered into xmon try to acquire a lock
(get_output_lock). Therefore, we can not view state of those CPU(s).

[This is a simple, very low risk, obvious fix for an obvious bug, and
should go into 2.6.13. -- paulus]

Signed-off-by: Haren Myneni <hbabu@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Haren Myneni and committed by Linus Torvalds 5cb4cc0d 0b2bfb4e

+3
+3
arch/ppc64/xmon/xmon.c
··· 329 printf("cpu 0x%x: Exception %lx %s in xmon, " 330 "returning to main loop\n", 331 cpu, regs->trap, getvecname(TRAP(regs))); 332 longjmp(xmon_fault_jmp[cpu], 1); 333 } 334 335 if (setjmp(recurse_jmp) != 0) { 336 if (!in_xmon || !xmon_gate) { 337 printf("xmon: WARNING: bad recursive fault " 338 "on cpu 0x%x\n", cpu); 339 goto waiting; 340 } 341 secondary = !(xmon_taken && cpu == xmon_owner);
··· 329 printf("cpu 0x%x: Exception %lx %s in xmon, " 330 "returning to main loop\n", 331 cpu, regs->trap, getvecname(TRAP(regs))); 332 + release_output_lock(); 333 longjmp(xmon_fault_jmp[cpu], 1); 334 } 335 336 if (setjmp(recurse_jmp) != 0) { 337 if (!in_xmon || !xmon_gate) { 338 + get_output_lock(); 339 printf("xmon: WARNING: bad recursive fault " 340 "on cpu 0x%x\n", cpu); 341 + release_output_lock(); 342 goto waiting; 343 } 344 secondary = !(xmon_taken && cpu == xmon_owner);