Skip to contentSkip to conversation

FAILED: patch "[PATCH] mtd: rawnand: davinci: Avoid duplicated page read" failed to apply to 5.4-stable tree

PATCH [email protected] 1 participant 1 message Jan 23, 2022

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 9c9d709965385de5a99f84b14bd5860e1541729e Mon Sep 17 00:00:00 2001
From: Paul Cercueil <[email protected]>
Date: Sat, 16 Oct 2021 14:22:25 +0100
Subject: [PATCH] mtd: rawnand: davinci: Avoid duplicated page read

The function nand_davinci_read_page_hwecc_oob_first() first reads the OOB data, extracts the ECC information, programs the ECC hardware before reading the actual data in a loop.

Right after the OOB data was read, it called nand_read_page_op() to reset the read cursor to the beginning of the page. This caused the first page to be read twice: in that call, and later in the loop.

Address that issue by changing the call to nand_read_page_op() to nand_change_read_column_op(), which will only reset the read cursor.

Cc <[email protected]> # v5.2
Fixes a0ac778eb82c ("mtd: rawnand: ingenic: Add support for the JZ4740")
drivers/mtd/nand/raw/davinci_nand.c +2 -1
index 89de24d3bb7a..2e6a0c1671be 100644
@@ -401,7 +401,8 @@ static int nand_davinci_read_page_hwecc_oob_first(struct nand_chip *chip,
 	if (ret)
 		return ret;
 
-	ret = nand_read_page_op(chip, page, 0, NULL, 0);
+	/* Move read cursor to start of page */
+	ret = nand_change_read_column_op(chip, 0, NULL, 0, false);
 	if (ret)
 		return ret;