[PATCH v2 2/2] mtd: rawnand: vf610_nfc: fix false bitflips on reads of erased pages

Mehmet Fide mehmet.fide at gmail.com
Mon Aug 31 04:40:00 PDT 2026


Hi Miquel,

> chip.ecc.size is not covering the whole data buffer. You should be
> reading mtd->writesize + mtd->oobsize, no? Otherwise you only overwrite
> the first ECC step (out of 2/4/8 depending on the configuration of
> the ECC engine).

On this controller there is only ever one step: attach_chip() rejects
any hwecc setup where ecc.size differs from the page size ("Step size
needs to be page size") and the engine protects the whole page in one
go, so ecc.size always equals the full data area here. But you are
right that mtd->writesize says that much more clearly, so I will use it
in v3.

> Unrelated, but this comment is wrong, we accept up to <strength>
> bitflips. Not a big deal though, the impact is very limited.

I will reword that comment in v3 to match what the code actually passes
(the driver's historic threshold of half the strength). If you would
rather see the threshold itself aligned to <strength>, I can send that
as a separate cleanup so it does not hide in a fix.

Thanks,
Mehmet



More information about the linux-mtd mailing list