Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93046
b: refs/heads/master
c: 67e5a28
h: refs/heads/master
v: v3
  • Loading branch information
Adrian Hunter authored and David Woodhouse committed Apr 22, 2008
1 parent 2a123cb commit b952596
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f1ebe4eba40e0ee862767893277d1b1a1e4cc85f
refs/heads/master: 67e5a28b35254bbbcd5bfce61ef646709e059bbf
15 changes: 15 additions & 0 deletions trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,21 @@ static int onenand_wait(struct mtd_info *mtd, int state)
printk(KERN_ERR "onenand_wait: controller error = 0x%04x\n", ctrl);
if (ctrl & ONENAND_CTRL_LOCK)
printk(KERN_ERR "onenand_wait: it's locked error.\n");
if (state == FL_READING) {
/*
* A power loss while writing can result in a page
* becoming unreadable. When the device is mounted
* again, reading that page gives controller errors.
* Upper level software like JFFS2 treat -EIO as fatal,
* refusing to mount at all. That means it is necessary
* to treat the error as an ECC error to allow recovery.
* Note that typically in this case, the eraseblock can
* still be erased and rewritten i.e. it has not become
* a bad block.
*/
mtd->ecc_stats.failed++;
return -EBADMSG;
}
return -EIO;
}

Expand Down

0 comments on commit b952596

Please sign in to comment.