Re: [PATCH v7 1/3] dt-bindings: mtd: spinand: Add randomizer enable/disable properties

From: Cheng Ming Lin

Date: Wed Feb 25 2026 - 20:41:58 EST


Hi Miquel,

Miquel Raynal <miquel.raynal@xxxxxxxxxxx> 於 2026年2月25日週三 下午11:10寫道:
>
> Hello Cheng Ming,
>
> On 25/02/2026 at 09:57:03 +08, Cheng Ming Lin <linchengming884@xxxxxxxxx> wrote:
>
> > From: Cheng Ming Lin <chengminglin@xxxxxxxxxxx>
> >
> > Add "nand-randomizer-enable" and "nand-randomizer-disable" boolean
> > properties.
> >
> > These properties allow enabling or disabling the randomizer feature
> > via the device tree.
> >
> > According to JEDEC standard JESD22-A117E, no single data pattern
> > represents a universal worst-case for all NAND flash failure mechanisms.
> > Different patterns, such as fully programmed, checkerboard, or mostly
> > erased, can disproportionately stress specific cells (e.g., programmed,
> > erased, or those influenced by adjacent states).
> >
> > Given that no fixed pattern can cover all scenarios, the use of a
> > randomized data pattern is a practical and effective mitigation strategy.
> > Our hardware implements a randomizer feature that scrambles user data
> > before it is written to the flash and restores the original data upon read.
> >
> > This ensures the data stored on the media is more evenly distributed,
> > thus reducing pattern-dependent degradation. This is especially crucial
> > for preventing errors caused by unbalanced data (e.g., all zeros or
> > all ones) in blocks with high program/erase (P/E) cycle counts.
> > Ultimately, the randomizer improves the long-term reliability and
> > endurance of the flash device.
> >
> > Please refer to the following link for randomizer feature:
> > Link:
> > https://www.mxic.com.tw/Lists/ApplicationNote/Attachments/2151/AN1051V1-The%20Introduction%20of%20Randomizer%20Feature%20on%20MX30xFxG28AD_MX35xFxG24AD.
>
> This link brings me to a "We have moved to our new home" page.

I apologize for the broken link. I will find the updated, active link
for the Application Note.

>
> Anyhow, this Link does not make much sense in the binding. If this is a
> very generic AN, why not, but maybe I'd move it to the SPI NAND patches,
> as the name implies that it is a bit specific to Macronix chips.

You are right about the placement. Since the randomizer feature and this
AN are indeed specific to Macronix chips, I agree it makes much more sense
in the driver patch. I will remove the link from the dt-binding commit
message and move the updated link to the SPI NAND patches in the next
version.

>
> > Signed-off-by: Cheng Ming Lin <chengminglin@xxxxxxxxxxx>
>
> Otherwise both the binding and code look ok from my PoV. So besides the
> Link that must be moved and fixed, I'll wait for binding approval.
>
> Thanks,
> Miquèl

Thanks,
Cheng Ming Lin