Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274953
b: refs/heads/master
c: 167a8d5
h: refs/heads/master
i:
  274951: cf5f56c
v: v3
  • Loading branch information
Brian Norris authored and Artem Bityutskiy committed Sep 21, 2011
1 parent 22d301d commit 5e994c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 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: d57f40544a41fdfe90fd863b6865138c5a82f1cc
refs/heads/master: 167a8d52509a0f7d6728a79e2588b800e866c147
17 changes: 12 additions & 5 deletions trunk/drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static u32 add_marker_len(struct nand_bbt_descr *td)
static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
struct nand_bbt_descr *td, int offs)
{
int res, i, j, act = 0;
int res, ret = 0, i, j, act = 0;
struct nand_chip *this = mtd->priv;
size_t retlen, len, totlen;
loff_t from;
Expand All @@ -204,11 +204,18 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
}
res = mtd->read(mtd, from, len, &retlen, buf);
if (res < 0) {
if (retlen != len) {
pr_info("nand_bbt: error reading bad block table\n");
if (mtd_is_eccerr(res)) {
pr_info("nand_bbt: ECC error in BBT at "
"0x%012llx\n", from & ~mtd->writesize);
return res;
} else if (mtd_is_bitflip(res)) {
pr_info("nand_bbt: corrected error in BBT at "
"0x%012llx\n", from & ~mtd->writesize);
ret = res;
} else {
pr_info("nand_bbt: error reading BBT\n");
return res;
}
pr_warn("nand_bbt: ECC error while reading bad block table\n");
}

/* Analyse data */
Expand Down Expand Up @@ -242,7 +249,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
totlen -= len;
from += len;
}
return 0;
return ret;
}

/**
Expand Down

0 comments on commit 5e994c9

Please sign in to comment.