[Cbe-oss-dev] [PATCH] fix reboot fail on kexec for CBE

Akira Tsukamoto akirat at rd.scei.sony.co.jp
Tue Apr 3 23:27:06 EST 2007


[PATCH] fix reboot fail on kexec for CBE

This patch adds additional TLB flush for dump-capture kernel to 
successfully reboot triggered by kexec. 

The same issue might exist on PS3 platform but I have not tried 
yet and the patch only applies to CBE platform.
I really appreciate if somebody could brush up this patch, as such 
using magic constant value inside the code.

Signed-off-by: Akira Tsukamoto <akirat at rd.scei.sony.co.jp>
Signed-off-by: Hideyuki Sasaki <xhide at rd.scei.sony.co.jp>
---------------------------------------------------------------
diff -uprNX dontdiff linux-2.6.20.4-arnd3/arch/powerpc/kernel/head_64.S linux-2.6.20.4-arnd3-aki1/arch/powerpc/kernel/head_64.S
--- linux-2.6.20.4-arnd3/arch/powerpc/kernel/head_64.S	2007-03-30 17:13:53.000000000 +0900
+++ linux-2.6.20.4-arnd3-aki1/arch/powerpc/kernel/head_64.S	2007-03-30 18:54:51.000000000 +0900
@@ -2010,6 +2010,9 @@ _STATIC(start_here_multiplatform)
 	mr	r3,r31
  	bl	.early_setup
 
+#if defined(CONFIG_PPC_CELL) && defined(CONFIG_CRASH_DUMP)
+	bl	.cbe_flush_tlb
+#endif
 	LOAD_REG_IMMEDIATE(r3, .start_here_common)
 	LOAD_REG_IMMEDIATE(r4, MSR_KERNEL)
 	mtspr	SPRN_SRR0,r3
diff -uprNX dontdiff linux-2.6.20.4-arnd3/arch/powerpc/platforms/cell/cbe_regs.c linux-2.6.20.4-arnd3-aki1/arch/powerpc/platforms/cell/cbe_regs.c
--- linux-2.6.20.4-arnd3/arch/powerpc/platforms/cell/cbe_regs.c	2007-03-30 17:25:29.000000000 +0900
+++ linux-2.6.20.4-arnd3-aki1/arch/powerpc/platforms/cell/cbe_regs.c	2007-03-30 18:51:22.000000000 +0900
@@ -273,3 +273,21 @@ void __init cbe_regs_init(void)
 	}
 }
 
+asmlinkage void cbe_flush_tlb(void)
+{
+	int i,j;
+	unsigned long tmp;
+	int ti,ts;
+
+	for (i = 0; i < 256; i++) {
+		ti = 0x10 * i;
+		for (j = 0; j < 4; j++) {
+			ts = 1 << j;
+			tmp = ti | ts;
+			mtspr(947, tmp);
+			mtspr(948, 0);
+		}
+	}
+
+}
+



-- 
Akira Tsukamoto
Sony Computer Entertainment Inc. 
Computer Development Div. Distributed OS Development Dept. 
Japan




More information about the cbe-oss-dev mailing list