]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: gpmi: Fix subpage reads
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 23 Jan 2018 10:13:17 +0000 (11:13 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 25 Jan 2018 08:14:20 +0000 (09:14 +0100)
commit0c50120b208a544cfff199ef4bee4f47c3d30dea
tree7894f9f33418684d6ac80d2e076285bade5c9a2c
parent05ab5d75a75695bfa72e7327a4a28f922524a19b
mtd: nand: gpmi: Fix subpage reads

Commit 04668ed19cb6 ("mtd: nand: force drivers to explicitly send
READ/PROG commands") added a call to nand_read_page_op() in
gpmi_ecc_read_page(), which means this function now sends a READ0
command and place the data pointer at the beginning of the page. This
logic is breaking gpmi_ecc_read_subpage() which was calling
gpmi_ecc_read_page() and expected it to only retrieve the data without
sending the READ0 command.

Create a gpmi_ecc_read_page_data() helper which only does the data
retrieval and ECC correction steps and implement gpmi_ecc_read_page()
as a wrapper that calls nand_read_page_op()+gpmi_ecc_read_page_data().

This way, gpmi_ecc_read_subpage() can call gpmi_ecc_read_page_data()
which restores the logic we had before commit 04668ed19cb6 ("mtd: nand:
force drivers to explicitly send READ/PROG commands").

Fixes: 04668ed19cb6 ("mtd: nand: force drivers to explicitly send READ/PROG commands")
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Acked-by: Han Xu <han.xu@nxp.com>
drivers/mtd/nand/gpmi-nand/gpmi-nand.c