Patchwork [3/3] omap : nand : fix subpage ecc issue with prefetch

login
register
mail settings
Submitter Bryan DE FARIA
Date April 29, 2011, 10:31 a.m.
Message ID <1304073070-24526-4-git-send-email-bdefaria@adeneo-embedded.com>
Download mbox | patch
Permalink /patch/93414/
State New
Headers show

Comments

Bryan DE FARIA - April 29, 2011, 10:31 a.m.
When reading a subpage with a non dividable by 4 ecc number of byte, the
prefetch function gets first the extra bytes, then reads the bytes lefting.
Extra bytes are not returned in the buffer (they are overwritten), which makes
the software ecc fail.

Signed-off-by: Bryan DE FARIA <bdefaria@adeneo-embedded.com>
---
 drivers/mtd/nand/omap2.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
vimal singh - April 29, 2011, 4 p.m.
On Fri, Apr 29, 2011 at 4:01 PM, Bryan DE FARIA
<bdefaria@adeneo-embedded.com> wrote:
> When reading a subpage with a non dividable by 4 ecc number of byte, the
> prefetch function gets first the extra bytes, then reads the bytes lefting.
> Extra bytes are not returned in the buffer (they are overwritten), which makes
> the software ecc fail.

Its not only read, write too is broken for the same reason. More ever,
it is broken for
other path too (failing to enable prefetch engine path).

Patch

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index eab51da..728db14 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -267,7 +267,6 @@  static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
 		else
 			omap_read_buf8(mtd, buf, len);
 	} else {
-		p = (u32 *) buf;
 		do {
 			r_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
 			r_count = r_count >> 2;