mtd: rawnand: brcmnand: correctly verify erased pages
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Tue, 12 May 2020 08:24:51 +0000 (10:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:14 +0000 (09:34 +0200)
commit736f040c25e0a2f0bb349eae8e62a5b5485d8543
treea9e54c681efe77303999962be18181944162a874
parent9f1dc009739ed6dbcbba44a927c5553e98fbc764
mtd: rawnand: brcmnand: correctly verify erased pages

commit dcb351c03f2fa6a599de1061b174167e03ee312b upstream.

The current code checks that the whole OOB area is erased.
This is a problem when JFFS2 cleanmarkers are added to the OOB, since it will
fail due to the usable OOB bytes not being 0xff.
Correct this by only checking that data and ECC bytes aren't 0xff.

Fixes: 02b88eea9f9c ("mtd: brcmnand: Add check for erased page bitflips")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200512082451.771212-1-noltari@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/raw/brcmnand/brcmnand.c