OSDN Git Service

mtd: mtd_oobtest: Handle bitflips during reads
authorMiquel Raynal <miquel.raynal@free-electrons.com>
Thu, 11 Jan 2018 20:39:20 +0000 (21:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:48:31 +0000 (19:48 +0200)
commitf6df92f22be342118d2eedbbcc5ca1953aab1a13
tree784121bf25b33360a8246da6414042e10db3005d
parent2a584051aba85f3fbb246c01429df073db3e3f2f
mtd: mtd_oobtest: Handle bitflips during reads

[ Upstream commit 12663b442e5ac5aa3d6097cd3f287c71ba46d26e ]

Reads from NAND devices usually trigger bitflips, this is an expected
behavior. While bitflips are under a given threshold, the MTD core
returns 0. However, when the number of corrected bitflips is above this
same threshold, -EUCLEAN is returned to inform the upper layer that this
block is slightly dying and soon the ECC engine will be overtaken so
actions should be taken to move the data out of it.

This particular condition should not be treated like an error and the
test should continue.

Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/tests/oobtest.c