MLK-22827-2: mxs_nand: don't check zero count when ECC reading with randomizer
authorHan Xu <han.xu@nxp.com>
Mon, 21 Oct 2019 15:42:02 +0000 (10:42 -0500)
committerYe Li <ye.li@nxp.com>
Thu, 24 Oct 2019 01:55:54 +0000 (18:55 -0700)
When enabled randomizer during ECC reading, the controller reported it's
erased page. Checking zero count will cause data get modified to all
0xFF. Stop checking during randomizer to workaround this issue.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit f88f68f29026b084396db003c60e0c15995d1670)

drivers/mtd/nand/raw/mxs_nand.c

index 4b0af37..fc954ff 100644 (file)
@@ -771,8 +771,9 @@ static int mxs_nand_ecc_read_page(struct mtd_info *mtd, struct nand_chip *nand,
                        continue;
 
                if (status[i] == 0xff) {
-                       if (is_mx6dqp() || is_mx7() ||
-                           is_mx6ul() || is_imx8() || is_imx8m())
+                       if (!nand_info->en_randomizer &&
+                           (is_mx6dqp() || is_mx7() || is_mx6ul()
+                           || is_imx8() || is_imx8m()))
                                if (readl(&bch_regs->hw_bch_debug1))
                                        flag = 1;
                        continue;