summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJason Liu <r64343@freescale.com>2008-03-25 21:57:06 -0500
committerRob Herring <r.herring@freescale.com>2009-02-16 11:26:53 -0600
commit16440f443cac63424533f60e8879deb6edd657cb (patch)
treec8d4aa3fc169d76b0fd9e7ce2bf8a4221ba024c3 /fs
parent6fa803e6ff1ea1026451e7157bc23d3270108146 (diff)
ENGR00069937 Community patch for Fix mount error in case of MLC flash
Even though we don't use the OOB for MLC nand flash, we should use the bad block information to skip the bad block. Patch url: http://patchwork.ozlabs.org/linux-mtd/patch?q=mlc&filter=none&id=15477 Author:Kyungmin Park Signed-off-by: Jason Liu <r64343@freescale.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/jffs2/scan.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 1d437de1e9a8..b07934bcf2fd 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -112,7 +112,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
if (!flashbuf) {
/* For NAND it's quicker to read a whole eraseblock at a time,
apparently */
- if (jffs2_cleanmarker_oob(c))
+ if (c->mtd->type == MTD_NANDFLASH)
buf_size = c->sector_size;
else
buf_size = PAGE_SIZE;
@@ -449,22 +449,24 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
D1(printk(KERN_DEBUG "jffs2_scan_eraseblock(): Scanning block at 0x%x\n", ofs));
#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
- if (jffs2_cleanmarker_oob(c)) {
+ if (c->mtd->type == MTD_NANDFLASH) {
int ret;
if (c->mtd->block_isbad(c->mtd, jeb->offset))
return BLK_STATE_BADBLOCK;
- ret = jffs2_check_nand_cleanmarker(c, jeb);
- D2(printk(KERN_NOTICE "jffs_check_nand_cleanmarker returned %d\n",ret));
+ if (jffs2_cleanmarker_oob(c)) {
+ ret = jffs2_check_nand_cleanmarker(c, jeb);
+ D2(printk(KERN_NOTICE "jffs_check_nand_cleanmarker returned %d\n", ret));
- /* Even if it's not found, we still scan to see
- if the block is empty. We use this information
- to decide whether to erase it or not. */
- switch (ret) {
- case 0: cleanmarkerfound = 1; break;
- case 1: break;
- default: return ret;
+ /* Even if it's not found, we still scan to see
+ if the block is empty. We use this information
+ to decide whether to erase it or not. */
+ switch (ret) {
+ case 0: cleanmarkerfound = 1; break;
+ case 1: break;
+ default: return ret;
+ }
}
}
#endif