Patch to mtd_debug "info" to provide a bad block count --

Martin Langhoff martin.langhoff at gmail.com
Wed Sep 2 10:14:37 EDT 2009


Hi list,

I've munged a patch initially floated by navigator.atreides at gmail.com
on this list to add a bad block count to the mtd_debug 'info' command.

The patch is here - http://dev.laptop.org/~martin/mtd_debug.patch

Using it on OLPC's XOs, I found that I had to "end" the scanning of
the device 4 blocks short of the actual end of device to avoid reading
the blocks reserved for BBT.

In the patch I have hardcoded the number of blocks to skip, but I
understand this may be configurable. Is there an ioctl to read the
number of blocks to skip?

I've also seen some patches to support per-chip BBT, which would make
this more complex again - so the point of this is actually
differentiating true bad blocks from blocks MTD protects from our
prying eyes (and from jffs2 I presume) wrongfully reporting them as
bad.

Either way, it'd be great if a variant of this patch finds its way
into the mtd-utils package, as this aids in-the-field debugging
enormously.

cheers,



m
-- 
 martin.langhoff at gmail.com
 martin at laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff



More information about the linux-mtd mailing list