]> git.baikalelectronics.ru Git - uboot.git/commit
mtd: nand: fsl_ifc: Fix handling of bitflips in erased pages
authorDarwin Dingel <darwin.dingel@alliedtelesis.co.nz>
Thu, 2 Aug 2018 08:02:45 +0000 (10:02 +0200)
committerYork Sun <york.sun@nxp.com>
Fri, 10 Aug 2018 17:35:51 +0000 (10:35 -0700)
commit338576ff69a86c787494a34b6b3c59260d3d503d
tree27c00385dec33370a5ff031aa048a03e847b36d3
parent2f514517e1fc1c8cdb7ceab457f03b7c86b98009
mtd: nand: fsl_ifc: Fix handling of bitflips in erased pages

This is a fix made for the fsl_ifc_nand driver on linux kernel by
Pavel Machek and is applied to uboot. It is currently on applied on
linux-mtd.

https://patchwork.kernel.org/patch/9758117/

IFC always raises ECC errors on erased pages. It is only ignored when
the buffer is checked for all 0xFF by is_blank(). The problem is a
single bitflip will cause is_blank() and then mtd_read to fail. The fix
makes use of nand_check_erased_ecc_chunk() to check for empty pages
instead of is_blank(). This also makes sure that reads are made at ECC
page size granularity to get a proper bitflip count. If the number of
bitflips does not exceed the ECC strength, the page is considered empty
and the bitflips will be corrected when data is sent to the higher
layers (e.g. ubi).

Signed-off-by: Darwin Dingel <darwin.dingel@alliedtelesis.co.nz>
Cc: Pavel Machek <pavel@denx.de>
Cc: Scott Wood <oss@buserror.net>
Acked-by: Pavel Machek <pavel@denx.de>
[Kurt: Replaced dev_err by printf due to compiler warnings]
Tested-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: York Sun <york.sun@nxp.com>
drivers/mtd/nand/fsl_ifc_nand.c