diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index ef034e53ef70..ce7e8654a3b3 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -571,7 +571,7 @@ static int spinand_read_page(struct spinand_device *spinand, const struct nand_page_io_req *req) { struct nand_device *nand = spinand_to_nand(spinand); - u8 status; + u8 status = 0; int ret; ret = nand_ecc_prepare_io_req(nand, (struct nand_page_io_req *)req); @@ -586,6 +586,16 @@ static int spinand_read_page(struct spinand_device *spinand, SPINAND_READ_INITIAL_DELAY_US, SPINAND_READ_POLL_DELAY_US, &status); + /* + * When there is data outside of OIP in the status, the status data is + * inaccurate and needs to be reconfirmed + */ + if (spinand->id.data[0] == 0x01 && status && !ret) { + ret = spinand_wait(spinand, + SPINAND_READ_INITIAL_DELAY_US, + SPINAND_READ_POLL_DELAY_US, + &status); + } if (ret < 0) return ret; diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c index cda84089a5b2..3d075f12ed82 100644 --- a/drivers/mtd/nand/spi/skyhigh.c +++ b/drivers/mtd/nand/spi/skyhigh.c @@ -26,8 +26,8 @@ static SPINAND_OP_VARIANTS(write_cache_variants, SPINAND_PROG_LOAD(true, 0, NULL, 0)); static SPINAND_OP_VARIANTS(update_cache_variants, - SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), - SPINAND_PROG_LOAD(false, 0, NULL, 0)); + SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), + SPINAND_PROG_LOAD(true, 0, NULL, 0)); static int s35ml04g3_ooblayout_ecc(struct mtd_info *mtd, int section, struct mtd_oob_region *region)