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>
这个提交包含在:
@@ -657,6 +657,11 @@ static int io_init(struct ubi_device *ubi)
|
||||
if (ubi->mtd->block_isbad && ubi->mtd->block_markbad)
|
||||
ubi->bad_allowed = 1;
|
||||
|
||||
if (ubi->mtd->type == MTD_NORFLASH) {
|
||||
ubi_assert(ubi->mtd->writesize == 1);
|
||||
ubi->nor_flash = 1;
|
||||
}
|
||||
|
||||
ubi->min_io_size = ubi->mtd->writesize;
|
||||
ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft;
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户