Re: [PATCH] mtd: rawnand: propagate BBT read transport errors

From: James Hilliard

Date: Wed Nov 18 2026 - 14:56:56 EST


On Wed, Nov 18, 2026 at 3:00 AM Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote:
>
> On 03/11/2026 at 23:03:39 -07, James Hilliard <james.hilliard1@xxxxxxxxx> wrote:
>
> > 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.
>
> Be honest, you did not read that back. I don't think one would guess the
> big picture by reading this. Here is a proposal:

I'm not seeing anything particularly difficult to understand in the
original explanation myself, although maybe I'm too accustomed to
reading this style of explanation.

A lot of these bugs were discovered using TLA+ tests based on LLM
translations of the driver logic into formal specifications, along with
fault injection tests, rather than through real-world hardware testing.

Because of this flow, the commit messages tend to follow a similar
pattern of first describing the code/logic relevant to the test
failure. I guess when the test case itself makes it clear to me why
something is a bug, I tend to make the commit message more or
less explain the failing test case rather than the bigger picture
implications.

I'll try and further analyze the bug implications beyond the immediate
test failures for future commits. Figuring out the right cut off point is
somewhat tricky however.

>
> ```
> ECC failures have dedicated recovery paths: -EBADMSG invalidates the
> affected copy and -EUCLEAN schedules a scrub. Any other read error
> (typically an I/O error) would be unhandled and leave the RAM table
> incomplete.
>
> Make sure those errors are propagated.
> ```
>
> Thanks,
> Miquèl