* [PATCH] mtd: rawnand: propagate BBT read transport errors
@ 2026-11-04 6:03 James Hilliard
0 siblings, 0 replies; only message in thread
From: James Hilliard @ 2026-11-04 6:03 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, James Hilliard
check_create() handles uncorrectable ECC errors by invalidating the
affected BBT copy and handles corrected errors by scheduling a rewrite.
Other read_abs_bbt() failures are ignored, allowing initialization to
succeed with missing entries in the RAM table or to rewrite a table that
was not completely read.
Return non-ECC read errors from both the selected table and the second
unversioned copy before updating versions or writing tables. A transport
failure does not establish that the selected table is corrupt or that an
older mirror contains all of its bad-block information. Preserve the
existing ECC-specific recovery paths.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
drivers/mtd/nand/raw/nand_bbt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mtd/nand/raw/nand_bbt.c b/drivers/mtd/nand/raw/nand_bbt.c
index b0e7592a2ab7..93c798ac4f9e 100644
--- a/drivers/mtd/nand/raw/nand_bbt.c
+++ b/drivers/mtd/nand/raw/nand_bbt.c
@@ -1023,6 +1023,8 @@ static int check_create(struct nand_chip *this, uint8_t *buf,
i--;
continue;
}
+ if (res < 0 && !mtd_is_bitflip(res))
+ return res;
}
/* If they weren't versioned, read both */
if (rd2) {
@@ -1034,6 +1036,8 @@ static int check_create(struct nand_chip *this, uint8_t *buf,
i--;
continue;
}
+ if (res2 < 0 && !mtd_is_bitflip(res2))
+ return res2;
}
/* Scrub the flash table(s)? */
---
base-commit: 30daaf3e7897b4a8d9b72e5b0c86dd6e2a4d7d85
change-id: 20261103-submit-rawnand-bbt-read-error-v1-eacbdd1e7970
Best regards,
--
James Hilliard <james.hilliard1@gmail.com>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-04 6:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 6:03 [PATCH] mtd: rawnand: propagate BBT read transport errors James Hilliard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®