All of lore.kernel.org
 help / color / mirror / Atom feed
* linux equivalent of u-boot's "nand scrub" (erasing blocks even when OOB says "bad")
@ 2010-09-10 23:53 Mike Frysinger
  2010-09-11  6:32 ` Artem Bityutskiy
  2010-09-13  5:54 ` linux equivalent of u-boot's "nand scrub" (erasing blocks even whenOOB " Jon Povey
  0 siblings, 2 replies; 13+ messages in thread
From: Mike Frysinger @ 2010-09-10 23:53 UTC (permalink / raw)
  To: linux-mtd

ive come across a situation where it would have been invaluable to
have the ability to "scrub" the nand flash while running linux.
unfortunately, while i can see options to mark blocks as bad, there
doesnt appear to be any ioctls to mark blocks as good.  this applies
both to the userspace api as well as the kernel api.

further, it seems like if (for whatever reason)  the bad block marker
in the oob region got screwed, there is absolutely no way to recover
(when not using a dedicated bbt).  in
drivers/mtd/nand/nand_base.c:nand_erase_nand(), the very first thing
it does is call nand_block_checkbad().  without a bbt, it'll tail into
chip->block_bad and the default nand_block_bad() reads the bad block
marker out of the oob.  but if the oob region has been screwed, the
block will be thought of as bad, and so you're stuck in a loop.  you
cant reset the oob to 0xff because the oob isnt 0xff ...

the logical thing in my mind would be to extend the userspace mtd abi
to allow a "do the erase even if people think it's bad" option.
perhaps MEMSCRUB ?
-mike

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-09-24  8:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 23:53 linux equivalent of u-boot's "nand scrub" (erasing blocks even when OOB says "bad") Mike Frysinger
2010-09-11  6:32 ` Artem Bityutskiy
2010-09-12  4:03   ` Mike Frysinger
2010-09-12  7:54     ` Artem Bityutskiy
2010-09-22  7:43       ` Mike Frysinger
2010-09-23 12:28         ` Artem Bityutskiy
2010-09-23 19:55           ` Mike Frysinger
2010-09-24  8:47             ` Artem Bityutskiy
2010-09-13  5:54 ` linux equivalent of u-boot's "nand scrub" (erasing blocks even whenOOB " Jon Povey
2010-09-13  6:25   ` Artem Bityutskiy
2010-09-14  1:16     ` Mike Frysinger
2010-09-14  1:53       ` Jon Povey
2010-09-14  1:59         ` Mike Frysinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.