JFFS2 doesn't use OOB at MLC NAND/OneNAND
PATCH 1/1 JFFS2 doesn't use OOB at MLC NAND/OneNAND
Hi,
It's revised patch from
http://patchwork.ozlabs.org/linux-mtd/patch?id=15260
Just remove one line
+#define MTD_CAP_MLC_NANDFLASH (MTD_WRITEABLE)
If you don't any rejct please apply this one.
Any comments are welcome.
Thank you,
Kyungmin Park
Signed-off-by Kyungmin Park <[email protected]>
--- fs/jffs2/erase.c | 1 + fs/jffs2/fs.c | 6 ++++-- fs/jffs2/os-linux.h | 2 +- include/mtd/mtd-abi.h | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-)
fs/jffs2/erase.c +1 -0
@@ -415,6 +415,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb/* Cleanmarker in oob area or no cleanmarker at all ? */ if (jffs2_cleanmarker_oob (c) || c->cleanmarker_size ==0 ) { +/* We only write cleanmarker in case of SLC NAND */ if (jffs2_cleanmarker_oob (c)) {if (jffs2_write_nand_cleanmarker (c, jeb)) goto filebad;
fs/jffs2/fs.c +4 -2
@@ -656,7 +656,9 @@ void jffs2_gc_release_page(struct jffs2_sb_info *c,static int jffs2_flash_setup (struct jffs2_sb_info *c) {int ret =0 ; -if (jffs2_cleanmarker_oob (c)) { +if (c->mtd->type ==MTD_NANDFLASH ) { +if (!(c->mtd->flags &MTD_OOB_WRITEABLE )) +printk (KERN_INFO "JFFS2 doesn't use OOB.\n" );/* NAND flash... do setup accordingly */ ret =jffs2_nand_flash_setup (c);if (ret)
@@ -689,7 +691,7 @@ static int jffs2_flash_setup(struct jffs2_sb_info *c) {void jffs2_flash_cleanup (struct jffs2_sb_info *c) { -if (jffs2_cleanmarker_oob (c)) { +if (c->mtd->type ==MTD_NANDFLASH ) {jffs2_nand_flash_cleanup (c); }
fs/jffs2/os-linux.h +1 -1
@@ -110,7 +110,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)#define jffs2_can_mark_obsolete (c) (c->mtd->flags & (MTD_BIT_WRITEABLE))#endif -#define jffs2_cleanmarker_oob (c) (c->mtd->type == MTD_NANDFLASH) +#define jffs2_cleanmarker_oob (c) (c->mtd->type == MTD_NANDFLASH && (c->mtd->flags & MTD_OOB_WRITEABLE))#define jffs2_flash_write_oob (c, ofs, len, retlen, buf) ((c)->mtd->write_oob((c)->mtd, ofs, len, retlen, buf))#define jffs2_flash_read_oob (c, ofs, len, retlen, buf) ((c)->mtd->read_oob((c)->mtd, ofs, len, retlen, buf))
include/mtd/mtd-abi.h +2 -1
@@ -30,12 +30,13 @@ struct mtd_oob_buf {#define MTD_BIT_WRITEABLE 0x800/* Single bits can be flipped */ #define MTD_NO_ERASE 0x1000/* No erase necessary */ #define MTD_STUPID_LOCK 0x2000/* Always locked after reset */ +#define MTD_OOB_WRITEABLE 0x4000/* Use Out-Of-Band area */ // Some common devices / combinations of capabilities #define MTD_CAP_ROM 0#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) -#define MTD_CAP_NANDFLASH (MTD_WRITEABLE) +#define MTD_CAP_NANDFLASH (MTD_WRITEABLE | MTD_OOB_WRITEABLE)/* ECC byte placement */ #define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended)
Signature · 1 line
1.5.0.6
Quoted 8 lines · Kyungmin Park
It's revised patch from
http://patchwork.ozlabs.org/linux-mtd/patch?id=15260Just remove one line
+#defineMTD_CAP_MLC_NANDFLASH(MTD_WRITEABLE)If you don't any rejct please apply this one.
Looks good to me.
Acked-by Joern Engel <[email protected]>
Jörn
Signature · 2 lines
Schrödinger's cat is <BLINK>not</BLINK> dead. -- Illiad