mtd: rawnand: brcmnand: fix OOB R/W with Hamming ECC
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Wed, 24 Feb 2021 08:02:10 +0000 (09:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:09 +0000 (09:50 +0200)
commit705ad2d8c3614871884bd59a3897b6cc5edd0068
treead3a9fada86089b84c1bff0ad8b94e771c3bc3da
parentc8f3837c51f8537764c33df570f3d549326c5043
mtd: rawnand: brcmnand: fix OOB R/W with Hamming ECC

[ Upstream commit f5200c14242fb8fa4a9b93f7fd4064d237e58785 ]

Hamming ECC doesn't cover the OOB data, so reading or writing OOB shall
always be done without ECC enabled.
This is a problem when adding JFFS2 cleanmarkers to erased blocks. If JFFS2
clenmarkers are added to the OOB with ECC enabled, OOB bytes will be changed
from ff ff ff to 00 00 00, reporting incorrect ECC errors.

Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210224080210.23686-1-noltari@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/raw/brcmnand/brcmnand.c