On Wed, 23 May 2012, Patrick wrote:
>
> I have tried "flash_erase -N /dev/mtd4 0 0" to revert the badblocks but
> it doesn't work (the kernel could not erase a block marked as bad).
It is easy to patch the kernel to ignore the check bad blocks when
erasing. IIRC you have to patch flash_erase too as it also checks for bad
blocks prior to issuing the erase ioctl.
The only thing is that unless you have kept a list of which blocks were
marked bad from the factory it is not possible to distinguish between
factory-marked bad blocks and subsequently marked bad blocks. On the other
hand, my experience with at least 1 GB SLC NAND flash is that if you erase
a factory-marked bad block, it either won't erase at all, or it does and
you can use it just as any other block. It may not be up to spec, and
definitely is not recommended in a production environment, but seems to be
generally ok in the lab.
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30