Skip to contentSkip to conversation

OneNAND: Update OOB free table

PATCH Kyungmin Park 2 participants 4 messages Dec 18, 2006 – Dec 21, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi all,

Quoted 5 lines · Artem Bityutskiy
Quoted 4 lines · Kyungmin Park
Quoted 2 lines

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

Quoted 8 lines
Quoted 1 line

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

--

jffs2/wbuf.c 18 Dec 2006 04:21:29 -0000 renamed from jffs2/wbuf.c 12 Oct 2006 05:50:30 -0000 1.1.1.1 +8 -0
diff -u -p -r1.1.1.1 wbuf.c
@@ -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)
#1 lore raw

Kyungmin,

Quoted 3 lines · Kyungmin Park

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

I will look at this a bit later unless dwmw2 does. I'm really snowed under at the moment. Apologies.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)
#2 lore raw
In reply to Kyungmin Park

Hello,

Quoted 2 lines · Kyungmin Park

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

Here is my understanding of the problem.

Nowadays MTD supports nicer interface to work with OOB. This is the MTD_OOB_AUTO command. Currently JFFS2 uses old MTD_OOB_PLACE command.

The idea behind the MTD_OOB_AUTO command is that user provides buffer with his data, and MTD takes care about how to put it to the OOB area, MTD knows which OOB bytes may be used. Similar for reading OOB - MTD automatically reads data bytes, skips ECC, and returns the data.

So what we should do is to teach JFFS2 using MTD_OOB_AUTO instead of MTD_OOB_PLACE.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)
#3 lore raw
Quoted 11 lines · Artem Bityutskiy

Hello,

Quoted 2 lines · Kyungmin Park

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

Here is my understanding of the problem.

Nowadays MTD supports nicer interface to work with OOB. This is the MTD_OOB_AUTO command. Currently JFFS2 uses old MTD_OOB_PLACE command.

Quoted 7 lines

The idea behind the MTD_OOB_AUTO command is that user provides buffer with his data, and MTD takes care about how to put it to the OOB area, MTD knows which OOB bytes may be used. Similar for reading OOB - MTD automatically reads data bytes, skips ECC, and returns the data.

So what we should do is to teach JFFS2 using MTD_OOB_AUTO instead of MTD_OOB_PLACE.

I may try to do this, but only in 2007. Vitaly said he may also try to do this later.

Also, dwmw2 is concerned about compatibility, so we should explore this too.

Kyungmin, may you make sure OneNAND is OK WRT MTD_OOB_AUTO?

Also Kyungmin, in you driver I see touch_softlockup_watchdog() calls. I believe they should not be there. You must be hid a problem with this instead of fixing it. Please, look at that stuff.

Kyungmin, do you have your own OneNAND git tree? If yes, what's the URL? How about putting it on infradead.org, just like we have our UBI git there?

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)