[PATCH v8 09/17] mtd: rawnand: sunxi: avoid a second program confirm for OOB writes
James Hilliard
james.hilliard1 at gmail.com
Thu Oct 15 20:45:24 PDT 2026
The hardware-ECC OOB writer fills the main-data buffer with 0xff and
calls the selected page writer to program it together with the requested
OOB. Both the PIO and DMA page writers already finish with
nand_prog_page_end_op(), which sends PAGEPROG, waits and checks NAND
status. The OOB wrapper then calls that helper again, sending a second
program confirm without another setup or data transfer. A failure of
that extra command is returned even though the actual write has already
succeeded.
Return the page writer's result directly. It remains responsible for the
single program confirm and status check, including on the
bad-block-marker write path. Raw OOB writes use separate callbacks and
are unchanged.
Fixes: 25f815f66a14 ("mtd: nand: force drivers to explicitly send READ/PROG commands")
Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>
---
drivers/mtd/nand/raw/sunxi_nand.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index fcb017f048db..9f03ba22b4b7 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -1832,15 +1832,10 @@ static int sunxi_nfc_hw_ecc_write_oob(struct nand_chip *nand, int page)
{
struct mtd_info *mtd = nand_to_mtd(nand);
u8 *buf = nand_get_data_buf(nand);
- int ret;
memset(buf, 0xff, mtd->writesize);
- ret = nand->ecc.write_page(nand, buf, 1, page);
- if (ret)
- return ret;
- /* Send command to program the OOB data */
- return nand_prog_page_end_op(nand);
+ return nand->ecc.write_page(nand, buf, 1, page);
}
static const struct sunxi_nfc_timings sun4i_a10_nfc_timings = {
--
2.53.0
More information about the linux-mtd
mailing list