[PATCH] mtd: nand: gpmi: Fix subpage reads

Han Xu han.xu at nxp.com
Wed Jan 24 19:07:26 PST 2018


________________________________________
From: Miquel Raynal <miquel.raynal at free-electrons.com>
Sent: Wednesday, January 24, 2018 6:51 AM
To: Boris Brezillon
Cc: Richard Weinberger; linux-mtd at lists.infradead.org; David Woodhouse; Brian Norris; Marek Vasut; Cyrille Pitchen; Han Xu
Subject: Re: [PATCH] mtd: nand: gpmi: Fix subpage reads

Hello Boris,

On Tue, 23 Jan 2018 11:13:17 +0100
Boris Brezillon <boris.brezillon at free-electrons.com> wrote:

> Commit 25f815f66a14 ("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 25f815f66a14 ("mtd: nand:
> force drivers to explicitly send READ/PROG commands").
>
> Fixes: 25f815f66a14 ("mtd: nand: force drivers to explicitly send READ/PROG commands")
> Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
> ---

Reviewed-by: Miquel Raynal <miquel.raynal at free-electrons.com>
Acked-by: Han Xu <han.xu at nxp.com>

Thanks for fixing it,
Miquèl



More information about the linux-mtd mailing list