[Cbe-oss-dev] [PATCH] EDAC - log a syndrome code in case of correctable error

Christian Krafft krafft at de.ibm.com
Tue Apr 1 00:50:08 EST 2008


Subject: EDAC - log a syndrome code in case of correctable error

From: Maxim Shchetynin <maxim at de.ibm.com>

If correctable error occurs the syndrome code was logged as 0. This patch
lets EDAC to log a correct syndrome code to make problem investigation
easier. It also prints out an error counter.

Signed-off-by: Maxim Shchetynin <maxim at de.ibm.com>
Signed-off-by: Christian Krafft <krafft at de.ibm.com>

Index: linux-2.6/drivers/edac/cell_edac.c
===================================================================
--- linux-2.6.orig/drivers/edac/cell_edac.c
+++ linux-2.6/drivers/edac/cell_edac.c
@@ -29,11 +29,13 @@ struct cell_edac_priv
 #endif
 };
 
-static void cell_edac_count_ce(struct mem_ctl_info *mci, int chan, u64 ar)
+static void cell_edac_count_ce(struct mem_ctl_info *mci, int chan, u64 ar,
+			       u64 fir_debug)
 {
 	struct cell_edac_priv		*priv = mci->pvt_info;
 	struct csrow_info		*csrow = &mci->csrows[0];
-	unsigned long			address, pfn, offset;
+	unsigned long			address, pfn, offset, syndrome,
lfsr;
+	char				msg[7 + 10 + 1];
 
 	dev_dbg(mci->dev, "ECC CE err on node %d, channel %d, ar = 0x%016lx\n",
 		priv->node, chan, ar);
@@ -44,10 +46,13 @@ static void cell_edac_count_ce(struct mem_ctl_info *mci,
int chan, u64 ar) address = (address << 1) | chan;
 	pfn = address >> PAGE_SHIFT;
 	offset = address & ~PAGE_MASK;
+	syndrome = (ar & 0x000000001fe00000ul) >> 21;
+	lfsr = (fir_debug & 0x000000000fc00000ul) >> 22;
+	sprintf(msg, "errcnt=%lu", lfsr);
 
 	/* TODO: Decoding of the error addresss */
 	edac_mc_handle_ce(mci, csrow->first_page + pfn, offset,
-			  0, 0, chan, "");
+			  syndrome, 0, chan, msg);
 }
 
 static void cell_edac_count_ue(struct mem_ctl_info *mci, int chan, u64 ar)
@@ -73,7 +78,7 @@ static void cell_edac_count_ue(struct mem_ctl_info *mci, int
chan, u64 ar) static void cell_edac_check(struct mem_ctl_info *mci)
 {
 	struct cell_edac_priv		*priv = mci->pvt_info;
-	u64				fir, addreg, clear = 0;
+	u64				fir, fir_debug, addreg, clear = 0;
 
 	fir = in_be64(&priv->regs->mic_fir);
 #ifdef DEBUG
@@ -84,13 +89,15 @@ static void cell_edac_check(struct mem_ctl_info *mci)
 #endif
 	if ((priv->chanmask & 0x1) && (fir & CBE_MIC_FIR_ECC_SINGLE_0_ERR)) {
 		addreg = in_be64(&priv->regs->mic_df_ecc_address_0);
+		fir_debug = in_be64(&priv->regs->mic_fir_debug);
 		clear |= CBE_MIC_FIR_ECC_SINGLE_0_RESET;
-		cell_edac_count_ce(mci, 0, addreg);
+		cell_edac_count_ce(mci, 0, addreg, fir_debug);
 	}
 	if ((priv->chanmask & 0x2) && (fir & CBE_MIC_FIR_ECC_SINGLE_1_ERR)) {
 		addreg = in_be64(&priv->regs->mic_df_ecc_address_1);
+		fir_debug = in_be64(&priv->regs->mic_fir_debug);
 		clear |= CBE_MIC_FIR_ECC_SINGLE_1_RESET;
-		cell_edac_count_ce(mci, 1, addreg);
+		cell_edac_count_ce(mci, 1, addreg, fir_debug);
 	}
 	if ((priv->chanmask & 0x1) && (fir & CBE_MIC_FIR_ECC_MULTI_0_ERR)) {
 		addreg = in_be64(&priv->regs->mic_df_ecc_address_0);


-- 
Mit freundlichen Gruessen,
kind regards,

Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist


Vorsitzender des Aufsichtsrats:	Martin Jetter
Geschaeftsfuehrung:		Herbert Kircher
Sitz der Gesellschaft:		Boeblingen
Registriergericht:		Amtsgericht Stuttgart, HRB 243294
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20080331/bd8fcc4b/attachment.pgp>


More information about the cbe-oss-dev mailing list