9
0
Fork 0

mtd: always write page when oob is given

Since recently we check for the page being written for not being
empty and do not actually write it when it is. This fails for a
freshly created flash bad block table when all blocks are good.
In this case the bbt code will try to write an empty page, but
with the BBT marker in OOB. This page never gets written, so the
BBT code will not find a bad block table during next start up and
writes it again. Fix this by checking if we want to write OOB data,
if we do, then write the page, even if the data is empty.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-02-25 15:10:56 +01:00
parent 3880243675
commit 10473b33d7
1 changed files with 1 additions and 1 deletions

View File

@ -320,7 +320,7 @@ int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
memset(chip->oob_poi, 0xff, mtd->oobsize);
}
if (!mtd_all_ff(wbuf, mtd->writesize)) {
if (oob || !mtd_all_ff(wbuf, mtd->writesize)) {
ret = chip->write_page(mtd, chip, wbuf, page, cached,
(ops->mode == MTD_OOB_RAW));
if (ret)