linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: qcom: Fix DMA sync on FLASH_STATUS register read
@ 2020-10-09  8:07 Praveenkumar I
  2020-10-28 10:08 ` Miquel Raynal
  2020-10-30 17:27 ` Miquel Raynal
  0 siblings, 2 replies; 4+ messages in thread
From: Praveenkumar I @ 2020-10-09  8:07 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr, sivaprak, peter.ujfalusi,
	boris.brezillon, linux-mtd, linux-kernel
  Cc: kathirav, Praveenkumar I, stable

After each codeword NAND_FLASH_STATUS is read for possible operational
failures. But there is no DMA sync for CPU operation before reading it
and this leads to incorrect or older copy of DMA buffer in reg_read_buf.

This patch adds the DMA sync on reg_read_buf for CPU before reading it.

Fixes: 5bc36b2bf6e2 ("mtd: rawnand: qcom: check for operation errors in case of raw read")
Signed-off-by: Praveenkumar I <ipkumar@codeaurora.org>
---
 drivers/mtd/nand/raw/qcom_nandc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index bd7a7251429b..5bb85f1ba84c 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -1570,6 +1570,8 @@ static int check_flash_errors(struct qcom_nand_host *host, int cw_cnt)
 	struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
 	int i;
 
+	nandc_read_buffer_sync(nandc, true);
+
 	for (i = 0; i < cw_cnt; i++) {
 		u32 flash = le32_to_cpu(nandc->reg_read_buf[i]);
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-30 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09  8:07 [PATCH] mtd: rawnand: qcom: Fix DMA sync on FLASH_STATUS register read Praveenkumar I
2020-10-28 10:08 ` Miquel Raynal
     [not found]   ` <24a781a3-488c-b638-1b92-0f279807446f@codeaurora.org>
2020-10-28 14:23     ` Miquel Raynal
2020-10-30 17:27 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).