diff mbox

powerpc/kdump: Fix timeout in crash_kexec_wait_realmode

Message ID 20110705161202.62dc7d24@kryten (mailing list archive)
State Superseded
Headers show

Commit Message

Anton Blanchard July 5, 2011, 6:12 a.m. UTC
We check for timeout expiry in the outer loop, but we also need to
check it in the inner loop or we can lock up forever waiting for a
CPU to hit real mode.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
---
diff mbox

Patch

Index: linux-powerpc/arch/powerpc/kernel/crash.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/kernel/crash.c	2011-07-05 15:04:18.512140484 +1000
+++ linux-powerpc/arch/powerpc/kernel/crash.c	2011-07-05 15:05:51.483747575 +1000
@@ -240,7 +240,8 @@  static void crash_kexec_wait_realmode(in
 		if (i == cpu)
 			continue;
 
-		while (paca[i].kexec_state < KEXEC_STATE_REAL_MODE) {
+		while ((paca[i].kexec_state < KEXEC_STATE_REAL_MODE) &&
+				(msecs > 0)) {
 			barrier();
 			if (!cpu_possible(i)) {
 				break;