[PATCH v3 07/15] mtd: rawnand: sunxi: avoid redundant column changes for extra OOB
James Hilliard
james.hilliard1 at gmail.com
Wed Sep 9 01:30:40 PDT 2026
The PIO write loop tracks the absolute NAND column in cur_off, while the
extra-OOB helper computes an offset relative to the start of OOB. Comparing
these values directly always requests a column change, even when the last
ECC step has already left the cursor at the start of the extra OOB bytes.
Include the page size in the comparison, matching the extra-OOB read
helper. Keep the explicit column change when the caller does not track the
cursor, as in the DMA path, or when the current column differs.
Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>
---
drivers/mtd/nand/raw/sunxi_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index 545da54b8908..16b2b39524a7 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -1497,7 +1497,7 @@ static int sunxi_nfc_hw_ecc_write_extra_oob(struct nand_chip *nand,
if (len <= 0)
return 0;
- if (!cur_off || *cur_off != offset) {
+ if (!cur_off || *cur_off != (offset + mtd->writesize)) {
ret = nand_change_write_column_op(nand, offset + mtd->writesize,
NULL, 0, false);
if (ret)
--
2.53.0
More information about the linux-mtd
mailing list