diff options
author | Huang Shijie <b32955@freescale.com> | 2010-12-17 11:19:20 +0800 |
---|---|---|
committer | Robby Cai <R63905@freescale.com> | 2010-12-17 13:46:56 +0800 |
commit | f56e8d4af6bc5f25584a43044386cf4e9e6b31dd (patch) | |
tree | a4f235753ea8a5d1c7572307f3f4c4e56912b032 /drivers | |
parent | 5905fe751625073fe5f3ec05bd4681864c591c5b (diff) |
ENGR00137101-6 mark the erase failed block to the bbt table.
If it return failure in erasing a block, mark the block bad
in the bbt table.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 8bc3e7bf8805..3a8216bbf838 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2586,6 +2586,12 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, instr->state = MTD_ERASE_FAILED; instr->fail_addr = ((loff_t)page << chip->page_shift); + + if (chip->bbt) { + int i = (page / pages_per_block) << 1; + chip->bbt[i >> 3] |= 0x03 << (i & 0x6); + mtd->ecc_stats.badblocks++; + } goto erase_exit; } |