[PATCH 0/5] mtd: docg3: fix spare-area transfers and ECC reporting

From: James Hilliard

Date: Sat Dec 05 2026 - 00:49:39 EST


DiskOnChip G3 exposes eight free bytes in its 16-byte spare area. An
AUTO read can return ECC bytes instead of those free bytes; an OOB-only
write of all eight free bytes is rejected. A later page write can also
pick up stale spare bytes instead of the bytes supplied by its caller.

Use the selected OOB layout for reads and writes. Retire staged bytes
after a successful program of their page or erase of their block pair.
On full-page reads, correct BCH errors in the buffer containing the
affected byte. Report the highest bitflip count across all pages read.

Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>

---
James Hilliard (5):
mtd: docg3: check whole-page OOB writes in the selected mode
mtd: docg3: invalidate staged OOB on page write and block erase
mtd: docg3: correct BCH errors in the buffer holding the affected byte
mtd: docg3: return the requested spare bytes in the selected OOB mode
mtd: docg3: report the maximum bitflip count across read pages

drivers/mtd/devices/docg3.c | 266 +++++++++++++++++++++-----------------------
1 file changed, 128 insertions(+), 138 deletions(-)
---
base-commit: 4e5457fcbc14d21e7c004c3159e78fc63838029e
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next
change-id: 20261204-submit-docg3-oob-fixes-v1-3ac1e192f872

Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>