mtd: nand: erase block before marking bad
authorBrian Norris <computersforpeace@gmail.com>
Sat, 14 Jan 2012 02:11:47 +0000 (18:11 -0800)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:11:34 +0000 (00:11 +0100)
commit009184296d957d864d6fa9ac2dd192d29e069878
tree6b5101ac812ba958c94f183eafe112063a835ad0
parent152b861622d55f7b17cb6069bd0b275fb559c29a
mtd: nand: erase block before marking bad

Many NAND flash systems (especially those with MLC NAND) cannot be
reliably written twice in a row. For instance, when marking a bad block,
the block may already have data written to it, and so we should attempt
to erase the block before writing a bad block marker to its OOB region.

We can ignore erase failures, since the block may be bad such that it
cannot be erased properly; we still attempt to write zeros to its spare
area.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_base.c