Skip to contentSkip to conversation

powerpc/fsl-booke: Handle L1 D-cache parity error correctly on e500mc

PATCH Applied Kumar Gala 1 participant 2 messages Aug 27, 2011 – Oct 12, 2011 PowerPC

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 powerpc/fsl-booke: Handle L1 D-cache parity error correctly on e500mc

If the L1 D-Cache is in write shadow mode the HW will auto-recover the error. However we might still log the error and cause a machine check (if L1CSR0[CPE] - Cache error checking enable). We should only treat the non-write shadow case as non-recoverable.

---
 arch/powerpc/include/asm/reg_booke.h |    3 +++
 arch/powerpc/kernel/traps.c          |    9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/reg_booke.h +3 -0
index 2d8c920..9856452 100644
@@ -551,6 +551,9 @@
 #define L1CSR1_ICFI	0x00000002	/* Instr Cache Flash Invalidate */
 #define L1CSR1_ICE	0x00000001	/* Instr Cache Enable */
 
+/* Bit definitions for L1CSR2. */
+#define L1CSR2_DCWS	0x40000000	/* Data Cache write shadow */
+
 /* Bit definitions for L2CSR0. */
 #define L2CSR0_L2E	0x80000000	/* L2 Cache Enable */
 #define L2CSR0_L2PE	0x40000000	/* L2 Cache Parity/ECC Enable */
arch/powerpc/kernel/traps.c +8 -1
index 1a01414..a1a40f9 100644
@@ -457,7 +457,14 @@ int machine_check_e500mc(struct pt_regs *regs)
 
 	if (reason & MCSR_DCPERR_MC) {
 		printk("Data Cache Parity Error\n");
-		recoverable = 0;
+
+		/*
+		 * In write shadow mode we auto-recover from the error, but it
+		 * may still get logged and cause a machine check.  We should
+		 * only treat the non-write shadow case as non-recoverable.
+		 */
+		if (!(mfspr(SPRN_L1CSR2) & L1CSR2_DCWS))
+			recoverable = 0;
 	}
 
 	if (reason & MCSR_L2MMU_MHIT) {
Signature · 1 line
1.7.3.4
author Applied
#1 lore raw
Quoted 10 lines · Kumar Gala

If the L1 D-Cache is in write shadow mode the HW will auto-recover the error. However we might still log the error and cause a machine check (if L1CSR0[CPE] - Cache error checking enable). We should only treat the non-write shadow case as non-recoverable.

---

arch/powerpc/include/asm/reg_booke.h |    3 +++
arch/powerpc/kernel/traps.c          |    9 ++++++++-
2 files changed, 11 insertions(+), 1 deletions(-)

applied

- k