summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/qcom_nandc.c
diff options
context:
space:
mode:
authorMd Sadre Alam <quic_mdalam@quicinc.com>2023-08-18 20:21:00 +0530
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-08-18 22:01:50 +0200
commit318207ffe487bde07e0ef229a9a51c896d66341e (patch)
tree94a652002e7f2d5b0abf36b14e77ca8680125b0b /drivers/mtd/nand/raw/qcom_nandc.c
parentb9e002a34420e5ba25d4283be870c48e0c9e005f (diff)
downloadlinux-stable-318207ffe487bde07e0ef229a9a51c896d66341e.tar.gz
linux-stable-318207ffe487bde07e0ef229a9a51c896d66341e.tar.bz2
linux-stable-318207ffe487bde07e0ef229a9a51c896d66341e.zip
mtd: rawnand: qcom: Clear buf_count and buf_start in raw read
Initialize buf_count and buf_start to 0 before starting the raw read. If we will not initialize then read staus will get updated with wrong value and we will see failure for even successful raw read transaction. Signed-off-by: Sricharan Ramabadhran <quic_srichara@quicinc.com> Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230818145101.23825-3-quic_mdalam@quicinc.com
Diffstat (limited to 'drivers/mtd/nand/raw/qcom_nandc.c')
-rw-r--r--drivers/mtd/nand/raw/qcom_nandc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 992e56572287..985c4f4e6180 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -1471,6 +1471,9 @@ qcom_nandc_read_cw_raw(struct mtd_info *mtd, struct nand_chip *chip,
int raw_cw = cw;
nand_read_page_op(chip, page, 0, NULL, 0);
+ nandc->buf_count = 0;
+ nandc->buf_start = 0;
+ clear_read_regs(nandc);
host->use_ecc = false;
if (nandc->props->qpic_v2)