UBI: fix NOR flash recovery
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 6 Jul 2009 05:57:53 +0000 (08:57 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 10 Jul 2009 09:16:28 +0000 (12:16 +0300)
commita597615e23567e37deed99a47c5088fe38faf20b
tree2b22f94ba25095344b3e92f2b478932a516b313e
parent7c92faeb5d9da8c1592af0ac8a4e6fa895f07183
UBI: fix NOR flash recovery

This commit fixes NOR flash recovery issues observed with Spansion
S29GL512N NOR.

When NOR erases, it first fills PEBs with zeroes, then sets all bytes
to 0xFF. Filling with zeroes starts from the end of the PEB. And when
power is cut, this results in PEBs containing correct EC and VID headers
but corrupted with zeros at the end. This confuses UBI and it mistakinly
accepts these PEBs and associate them with LEBs.

Fis this issue by zeroing EC and VID magics before erasing PEBs, to
make UBI later refuse zem.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/build.c
drivers/mtd/ubi/io.c
drivers/mtd/ubi/ubi.h