Some questions on bit-flips and JFFS2
Norbert van Bolhuis
nvbolhuis at aimvalley.nl
Wed May 5 04:34:14 EDT 2010
Thorsten Mühlfelder wrote:
.
.
.
>> Maybe, as said check/ask your hardware supplier.
>> Maybe "refreshing" the block helps (that is saving the data, erasing the
>> block(s) and reprogramming all data). You could try this.
>
> I've already thought about something like this:
> 1. After first succesful bootup dump a mtd0 image and calculate a md5sum of
> it:
> nanddump -o -b -f mtd0.img /dev/mtd0
> 2. Before each shutdown dump the image again and check if the md5sum has
> changed.
> 3. If it has changed write the initial dump back:
> flash_eraseall /dev/mtd0
> nandwrite -p /dev/mtd0 mtd0.img
>
> Would this be the right method?
>
yes that's the idea, given that "refreshing" really helps to prevent
(actually delay) future read disturbs.
But this won't work well. nanddump doesn't tell you the single=corrected
bit errors.
Only if there's an uncorrectable error (2 or more bits flip) a change will
be detected and the data will be refreshed. A read disturb tends to be
unstable though, meaning sometimes it's there and sometimes not.
This means you may miss an uncorrectable error (2 bits flip).
Another problem is a sudden reboot (e.g. crash or power-loss). There's no
check then.
It much more easier to let UBI/UBIFS deal with this suff. It's designed for
this.
u-boot support UBIFS (read-only). This means you can put a kernel image
on UBIFS and make u-boot read/boot it.
hth,
Norbert van Bolhuis.
More information about the linux-mtd
mailing list