From: Boris Brezillon <boris.brezil...@free-electrons.com>

Drivers setting NAND_ECC_CUSTOM_PAGE_ACCESS are supposed to handle the
full read/write page sequence, and waiting for a page to actually be
programmed is part of this write-page sequence.
This is also what is done in ->write_oob_xxx() hooks, so let's do that in
->write_page_xxx() as well to make it consistent.

Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com>
[Linux commit: 41145649f4acb30249b636b945053db50c9331c5]
[masahiro:
 There is no driver setting NAND_ECC_CUSTOM_PAGE_ACCESS in U-Boot.
 No driver is affected by this change.]
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>

---

 drivers/mtd/nand/nand_base.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 91afa47..16d4554 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2439,12 +2439,13 @@ static int nand_write_page(struct mtd_info *mtd, struct 
nand_chip *chip,
        if (status < 0)
                return status;
 
-       if (nand_standard_page_accessors(&chip->ecc))
+       if (nand_standard_page_accessors(&chip->ecc)) {
                chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
-       status = chip->waitfunc(mtd, chip);
 
-       if (status & NAND_STATUS_FAIL)
-               return -EIO;
+               status = chip->waitfunc(mtd, chip);
+               if (status & NAND_STATUS_FAIL)
+                       return -EIO;
+       }
 
        return 0;
 }
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to