Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274895
b: refs/heads/master
c: 903cd06
h: refs/heads/master
i:
  274893: 5c8a81e
  274891: 1e04ead
  274887: 707c9fc
  274879: 3cf0aa4
v: v3
  • Loading branch information
Brian Norris authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 8e49719 commit dcdf6d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51b11e3630672b7ce8793ecf13e5759656edf38a
refs/heads/master: 903cd06cd6ece7f9050a3ad5b03e0b76be2882ff
13 changes: 10 additions & 3 deletions trunk/drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,20 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
ops.oobbuf = buf + len;
ops.datbuf = buf;
ops.len = len;
return mtd->read_oob(mtd, offs, &ops);
res = mtd->read_oob(mtd, offs, &ops);

/* Ignore ECC errors when checking for BBM */
if (res != -EUCLEAN && res != -EBADMSG)
return res;
return 0;
} else {
ops.oobbuf = buf + mtd->writesize;
ops.datbuf = buf;
ops.len = mtd->writesize;
res = mtd->read_oob(mtd, offs, &ops);

if (res)
/* Ignore ECC errors when checking for BBM */
if (res && res != -EUCLEAN && res != -EBADMSG)
return res;
}

Expand Down Expand Up @@ -435,7 +441,8 @@ static int scan_block_fast(struct mtd_info *mtd, struct nand_bbt_descr *bd,
* byte reads for 16 bit buswidth.
*/
ret = mtd->read_oob(mtd, offs, &ops);
if (ret)
/* Ignore ECC errors when checking for BBM */
if (ret && ret != -EUCLEAN && ret != -EBADMSG)
return ret;

if (check_short_pattern(buf, bd))
Expand Down

0 comments on commit dcdf6d5

Please sign in to comment.