mtd: rawnand: meson: fix OOB available bytes for ECC
authorArseniy Krasnov <AVKrasnov@sberdevices.ru>
Wed, 5 Jul 2023 06:52:10 +0000 (09:52 +0300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 12 Jul 2023 11:39:47 +0000 (13:39 +0200)
commit7e6b04f9238eab0f684fafd158c1f32ea65b9eaa
tree1703dea8616644bfb93f2040c3c9f630e7dfac0b
parentd8403b9eeee66d5dd81ecb9445800b108c267ce3
mtd: rawnand: meson: fix OOB available bytes for ECC

It is incorrect to calculate number of OOB bytes for ECC engine using
some "already known" ECC step size (1024 bytes here). Number of such
bytes for ECC engine must be whole OOB except 2 bytes for bad block
marker, while proper ECC step size and strength will be selected by
ECC logic.

Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230705065211.293500-1-AVKrasnov@sberdevices.ru
drivers/mtd/nand/raw/meson_nand.c