Re: [PATCH v2] mtd: rawnand: sunxi: fit maximized ECC step to page size
From: Miquel Raynal
Date: Tue Sep 08 2026 - 14:28:20 EST
On 08/09/2026 at 09:27:08 -06, James Hilliard <james.hilliard1@xxxxxxxxx> wrote:
> On Tue, Sep 8, 2026 at 4:03 AM Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote:
>>
>> Hello James,
>>
>> On 04/09/2026 at 16:39:27 -06, James Hilliard <james.hilliard1@xxxxxxxxx> wrote:
>>
>> > When nand-ecc-maximize is set, the driver unconditionally selects a
>> > 1024-byte ECC step. A NAND with a 512-byte page consequently produces
>> > zero ECC steps before the available OOB bytes are divided by the step
>> > count.
>> >
>> > The older sunxi NAND controllers support 512-byte ECC blocks. Select the
>> > smaller of the page size and the preferred 1024-byte step, using a
>> > 512-byte step for a 512-byte page while retaining 1024-byte steps for
>> > larger pages. Unsupported smaller steps and controllers without
>> > 512-byte support continue to be rejected by the existing checks.
>> >
>> > Fixes: 4796d8655915 ("mtd: nand: sunxi: Support ECC maximization")
>> > Cc: stable@xxxxxxxxxxxxxxx
>> > Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
>>
>> As reported by Sashiko, there is another use of 1024 down the road which
>> must be modified accordingly. Although, in practice, 512-byte page NANDs
>> have disappeared for quite some time, so this is a theoretical fix more
>> than a real problem.
>
> Does the v3 I sent look like it should work?:
> https://lore.kernel.org/all/20260904-submit-sunxi-nand-ecc-step-validation-v3-1-931cec317c10@xxxxxxxxx/
Yes I think so.