From ac4c9b12bf6717c6a088f69b768a55a60763c7c3 Mon Sep 17 00:00:00 2001 From: Yonghui Yu Date: Wed, 19 Apr 2017 10:47:50 +0800 Subject: [PATCH] nand: fix wait ready condition for samsung slc. PD#142961: only status[7] of samsung indicate the R/B status, as others using status[6:7]. Change-Id: I6b6030c868f81e250b4c96629025c1aeeb7b7d65 Signed-off-by: Yonghui Yu --- drivers/amlogic/mtd/aml_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/mtd/aml_nand.c b/drivers/amlogic/mtd/aml_nand.c index 9085554..433272a0 100644 --- a/drivers/amlogic/mtd/aml_nand.c +++ b/drivers/amlogic/mtd/aml_nand.c @@ -677,7 +677,8 @@ retry_status: /* udelay(200); */ } status[i] = (int)chip->read_byte(mtd); - if ((read_status++ < 3) && (status[i] != 0xe0)) { + if ((read_status++ < 3) + && (!(status[i] & NAND_STATUS_READY))) { pr_info("after write,read %d status =%d fail\n", read_status, status[i]); goto retry_status; -- 2.7.4