OneNAND: Update OOB free table

Kyungmin Park kyungmin.park at samsung.com
Sun Dec 17 23:24:02 EST 2006


Hi all,

> On Fri, Dec 15, 2006 at 12:41:53PM +0200, Artem Bityutskiy wrote:
> > On Fri, 2006-12-15 at 02:38 +0000, Kyungmin Park wrote:
> > > How about the the change the JFFS2 logic to skip the eccpos in cleanmark check.
> > > In onenand_oob_64, it describes the eccpos. So the JFFS2 skip the eccpos
> > 
> > May you refine what is the problem please?

> jffs2_check_oob_empty() check that the whole OOB area contains only 0xff
> bytes except for the clean marker area. This is broken on OneNAND as writing
> clean marker to OOB area will change ECC bytes.
>
> Also the clean marker is not written properly as only the first oobfree
> table element is used. But this is a different issue.

How about the this patch?
It skips the ecc position which is defined in ecc layout in mtd drivers.

Thank you,
Kyungmin Park

--

diff -u -p -r1.1.1.1 wbuf.c
--- fs/jffs2/wbuf.c     12 Oct 2006 05:50:30 -0000      1.1.1.1
+++ fs/jffs2/wbuf.c     18 Dec 2006 04:21:29 -0000
@@ -967,6 +967,8 @@ int jffs2_check_oob_empty(struct jffs2_s
        int i, page, ret;
        int oobsize = c->mtd->oobsize;
        struct mtd_oob_ops ops;
+       struct nand_ecclayout *oinfo = c->mtd->ecclayout;
+       int eccpos = 0;

        ops.len = NR_OOB_SCAN_PAGES * oobsize;
        ops.ooblen = oobsize;
@@ -991,6 +993,12 @@ int jffs2_check_oob_empty(struct jffs2_s

        /* Special check for first page */
        for(i = 0; i < oobsize ; i++) {
+               /* Skip ECC position for OneNAND */
+               if (i == oinfo->eccpos[eccpos]) {
+                       eccpos++;
+                       continue;
+               }
+
                /* Yeah, we know about the cleanmarker. */
                if (mode && i >= c->fsdata_pos &&
                    i < c->fsdata_pos + c->fsdata_len)




More information about the linux-mtd mailing list