Patchwork powerpc/kdump: Fix timeout in crash_kexec_wait_realmode

login
register
mail settings
Submitter Anton Blanchard
Date July 5, 2011, 6:12 a.m.
Message ID <20110705161202.62dc7d24@kryten>
Download mbox | patch
Permalink /patch/103202/
State Superseded
Headers show

Comments

Anton Blanchard - July 5, 2011, 6:12 a.m.
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>
---

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;