[PATCH] mtd: nand: Fix nand_do_read_oob() return value

Miquel RAYNAL miquel.raynal at free-electrons.com
Thu Jan 11 13:20:20 PST 2018


On Thu, 11 Jan 2018 21:39:58 +0100
Miquel Raynal <miquel.raynal at free-electrons.com> wrote:

> Starting from commit 041e4575f034 ("mtd: nand: handle ECC errors in
> OOB"), nand_do_read_oob() (from the NAND core) did return 0 or a
> negative error, and the MTD layer expected it.
> 
> However, the trend for the NAND layer is now to return an error or a
> positive number of bitflips. Deciding which status to return to the
> user belongs to the MTD layer.
> 
> Commit e47f68587b82 ("mtd: check for max_bitflips in mtd_read_oob()")
> brought this logic to the mtd_read_oob() function while the status
> coming from nand_do_read_oob() (called by the ->ecc.read_oob() hook)
> was left unchanged.
> 
> Fixes: e47f68587b82 ("mtd: check for max_bitflips in mtd_read_oob()")
> Cc: stable at vger.kernel.org
> Signed-off-by: Miquel Raynal <miquel.raynal at free-electrons.com>
> ---

Oops, patch untested, will send a v2, sorry for the noise.

Thanks,
Miquèl



More information about the linux-mtd mailing list