mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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: a0ac778eb8 ("mtd: rawnand: ingenic: Add support for the JZ4740")
Signed-off-by: Paul Cercueil <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
This commit is contained in:
1 parent
71e8959150
commit
9c9d709965
1 file changed
+2
-1
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user