linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] mtd: eLBC NAND: update ecc_stats.corrected when lteccr available
@ 2011-07-26 20:07 Michael Hench
  2011-07-26 20:10 ` Scott Wood
  2011-08-15 14:53 ` Artem Bityutskiy
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Hench @ 2011-07-26 20:07 UTC (permalink / raw)
  To: scottwood, linux-mtd, linuxppc-dev, mhench, mlcreech

update ecc_stats.corrected if LTECCR register is available.

v2: kernel standard C formatting

v3: kernel standard C formatting again, changed a comment to get under 80 chars

Signed-off-by: Michael Hench <MichaelHench@gmail.com>
---
diff -purN orig/drivers/mtd/nand/fsl_elbc_nand.c
linux-3.0/drivers/mtd/nand/fsl_elbc_nand.c
--- orig/drivers/mtd/nand/fsl_elbc_nand.c	2011-07-25 14:50:56.838326055 -0500
+++ linux-3.0/drivers/mtd/nand/fsl_elbc_nand.c	2011-07-25
14:48:35.680940052 -0500
@@ -256,6 +256,25 @@ static int fsl_elbc_run_command(struct m
 		return -EIO;
 	}

+	if (chip->ecc.mode != NAND_ECC_HW)
+		return 0;
+
+	if (elbc_fcm_ctrl->read_bytes == mtd->writesize + mtd->oobsize) {
+		uint32_t lteccr = in_be32(&lbc->lteccr);
+		/*
+		 * if command was a full page read and the ELBC
+		 * has the LTECCR register, then bits 12-15 (ppc order) of
+		 * LTECCR indicates which 512 byte sub-pages had fixed errors.
+		 * bits 28-31 are uncorrectable errors, marked elsewhere.
+		 * for small page nand only 1 bit is used.
+		 * if the ELBC doesn't have the lteccr register it reads 0
+		 */
+		if (lteccr & 0x000F000F)
+			out_be32(&lbc->lteccr, 0x000F000F); /* clear lteccr */
+		if (lteccr & 0x000F0000)
+			mtd->ecc_stats.corrected++;
+	}
+
 	return 0;
 }

--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] mtd: eLBC NAND: update ecc_stats.corrected when lteccr available
  2011-07-26 20:07 [PATCH v3] mtd: eLBC NAND: update ecc_stats.corrected when lteccr available Michael Hench
@ 2011-07-26 20:10 ` Scott Wood
  2011-08-15 14:53 ` Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: Scott Wood @ 2011-07-26 20:10 UTC (permalink / raw)
  To: MichaelHench; +Cc: linuxppc-dev, linux-mtd, mlcreech, mhench

On Tue, 26 Jul 2011 15:07:42 -0500
Michael Hench <michaelhench@gmail.com> wrote:

> update ecc_stats.corrected if LTECCR register is available.
> 
> v2: kernel standard C formatting
> 
> v3: kernel standard C formatting again, changed a comment to get under 80 chars
> 
> Signed-off-by: Michael Hench <MichaelHench@gmail.com>

Acked-by: Scott Wood <scottwood@freescale.com>

-Scott

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] mtd: eLBC NAND: update ecc_stats.corrected when lteccr available
  2011-07-26 20:07 [PATCH v3] mtd: eLBC NAND: update ecc_stats.corrected when lteccr available Michael Hench
  2011-07-26 20:10 ` Scott Wood
@ 2011-08-15 14:53 ` Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2011-08-15 14:53 UTC (permalink / raw)
  To: MichaelHench; +Cc: scottwood, linuxppc-dev, linux-mtd, mlcreech, mhench

On Tue, 2011-07-26 at 15:07 -0500, Michael Hench wrote:
> update ecc_stats.corrected if LTECCR register is available.
> 
> v2: kernel standard C formatting
> 
> v3: kernel standard C formatting again, changed a comment to get under 80 chars
> 
> Signed-off-by: Michael Hench <MichaelHench@gmail.com>

Pushed to l2-mtd-2.6.git, thanks.

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-15 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26 20:07 [PATCH v3] mtd: eLBC NAND: update ecc_stats.corrected when lteccr available Michael Hench
2011-07-26 20:10 ` Scott Wood
2011-08-15 14:53 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).