linux/drivers/mtd
Artem Bityutskiy 7ac760c2f7 UBI: fix corrupted PEB detection for NOR flash
My new shiny code for corrupted PEB detection has NOR specific bug.
We tread PEB as corrupted and preserve it, if

1. EC header is OK.
2. VID header is corrupted.
3. data area is not "all 0xFFs"

In case of NOR we have 'nor_erase_prepare()' quirk, which invalidates
the headers before erasing the PEB. And we invalidate first the VID
header, and then the EC header. So if a power cut happens after we have
invalidated the VID header, but before we have invalidated the EC
header, we end up with a PEB which satisfies the above 3 conditions,
and the scanning code will treat it as corrupted, and will print
scary warnings, wrongly.

This patch fixes the issue by firt invalidating the EC header, then
invalidating the VID header. In case of power cut inbetween, we still
just lose the EC header, and UBI can deal with this situation gracefully.

Thanks to Anatolij Gustschin <agust@denx.de> for tracking this down.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reported-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Anatolij Gustschin <agust@denx.de>
2010-12-03 15:49:21 +02:00
..
chips Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2010-10-30 12:35:11 +01:00
devices mtd: fix build error in m25p80.c 2010-10-30 12:46:08 +01:00
lpddr
maps Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2010-10-30 12:35:11 +01:00
nand Merge git://git.infradead.org/mtd-2.6 2010-10-30 08:31:35 -07:00
onenand mtd: OneNAND: S5PC110: Fix double call suspend & resume function 2010-10-25 01:36:14 +01:00
tests
ubi UBI: fix corrupted PEB detection for NOR flash 2010-12-03 15:49:21 +02:00
afs.c
ar7part.c
cmdlinepart.c
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c mtd: Remove redundant mutex from mtd_blkdevs.c 2010-10-30 12:39:21 +01:00
mtdblock_ro.c
mtdblock.c
mtdchar.c Merge git://git.infradead.org/mtd-2.6 2010-10-30 08:31:35 -07:00
mtdconcat.c
mtdcore.c
mtdcore.h
mtdoops.c
mtdpart.c
mtdsuper.c convert get_sb_mtd() users to ->mount() 2010-10-29 04:16:26 -04:00
nftlcore.c
nftlmount.c
ofpart.c
redboot.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h mtd: sm_ftl: cosmetic, use bool when possible 2010-10-25 01:33:08 +01:00
ssfdc.c