Skip to content

mtd: rawnand: vf610_nfc: fix reads on chips with more than 64 bytes of OOB

Mehmet Fide linux-mtd lkml stable 3 versions – Applied

Status from this message: Applied to mtd/fixes, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyApplied
  2. v22 patches 8 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2mtd: rawnand: vf610_nfc: fix reads on chips with more than 64 bytes of OOBdrivers/mtd/nand/raw/vf610_nfc.c+60 -120 replies
2/2mtd: rawnand: vf610_nfc: fix false bitflips on reads of erased pagesdrivers/mtd/nand/raw/vf610_nfc.c+11 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] mtd: rawnand: vf610_nfc: fix reads on chips with more than 64 bytes of OOB

From: Mehmet Fide <[email protected]>

The driver only implements the 64-byte OOB format the controller transfers, so chips with a larger OOB (the Colibri VF61's MX30LF4G28AC has 112 bytes) stopped working when nanddev_init() began restoring mtd->oobsize after ->attach_chip(): the parity moved and every ECC-protected read failed, including the BBT and everything UBI needs.

The detected OOB size stays, the driver gets its own mtd_ooblayout_ops computed on the first 64 OOB bytes, and the data paths keep transferring exactly those 64 spare bytes, so the on-flash format stays identical to U-Boot and to the kernels that clamped.

v3 addresses Miquel's review and the confirmed finding from the Sashiko
report: ECC page reads now fill the tail of oob_poi with 0xff, since mtd->oobsize bytes of it may reach userspace while only 64 are transferred. Retested on both boards. Colibri VF61 (112 bytes of OOB):
BBT found and read clean, UBI attaches and the UBIFS root mounts, 8 MiB write/read-back intact, and OOB reads return 0xff in the 48 bytes past the transferred area on every page sampled (6000+ pages, written and erased). Colibri VF50 (64-byte chip, tail fill is a no-op): layout unchanged, corrected counter stays zero across a full dump.

v2: https://lore.kernel.org/linux-mtd/[email protected]/
v1: https://lore.kernel.org/linux-mtd/[email protected]/

Mehmet Fide (2):
mtd: rawnand: vf610_nfc: fix reads on chips with more than 64 bytes of
OOB
mtd: rawnand: vf610_nfc: fix false bitflips on reads of erased pages

 drivers/mtd/nand/raw/vf610_nfc.c | 85 ++++++++++++++++++++++++++------
 1 file changed, 70 insertions(+), 15 deletions(-)
Signature · 1 line
2.54.0