[U-Boot] [PATCH 1/1] mtd: nand: fsl_ifc: Fix handling of bitflips in erased pages

Kurt Kanzenbach kurt.kanzenbach at linutronix.de
Mon Aug 13 09:02:28 UTC 2018


On Thu, Aug 09, 2018 at 07:58:02PM +0000, York Sun wrote:
> On 08/08/2018 04:55 AM, Kurt Kanzenbach wrote:
> > Hi York,
> >
> > On Tue, Aug 07, 2018 at 09:52:46PM +0000, York Sun wrote:
> >> On 08/02/2018 01:03 AM, Kurt Kanzenbach wrote:
> >>> From: Darwin Dingel <darwin.dingel at alliedtelesis.co.nz>
> >>>
> >>> 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://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fpatch%2F9758117%2F&data=02%7C01%7Cyork.sun%40nxp.com%7C79aca70c61e943b59b1d08d5f84e77eb%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636687938268644852&sdata=PjrH%2FF6LyGA%2BpVjHfqQpn4qhvJKeRHG%2Fb3434wuQy3o%3D&reserved=0
> >>>
> >>> 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 at alliedtelesis.co.nz>
> >>> Cc: Pavel Machek <pavel at denx.de>
> >>> Cc: Scott Wood <oss at buserror.net>
> >>> Acked-by: Pavel Machek <pavel at denx.de>
> >>> [Kurt: Replaced dev_err by printf due to compiler warnings]
> >>> Tested-by: Kurt Kanzenbach <kurt at linutronix.de>
> >>> Signed-off-by: Kurt Kanzenbach <kurt at linutronix.de>
> >>> ---
> >>>  drivers/mtd/nand/fsl_ifc_nand.c | 69 +++++++++++++++++++++++------------------
> >>>  1 file changed, 39 insertions(+), 30 deletions(-)
> >>
> >> Scott,
> >>
> >> Please comment. I can bring it in with your ack.
> >
> > I guess Scott stepped down as NAND maintainer (see MAINTAINERS
> > file). That's why I sent the patch directly to you.
> >
>
> The patch looks OK. I tested it on ls1043ardb with nand boot. I can see
> this code works OK. Will bring it in on my next pull request.

Thank you for testing the patch and bringing it in.

-- Kurt


More information about the U-Boot mailing list