[PATCH] spi-nor: Verify written data in paranoid mode

Richard Weinberger richard at nod.at
Wed Apr 16 06:09:03 PDT 2025


----- Ursprüngliche Mail -----
> Von: "Csókás Bence" <csokas.bence at prolan.hu>
>>> Add MTD_SPI_NOR_PARANOID config option for verifying all written data to
>>> prevent silent bit errors to be undetected, at the cost of halving SPI
>>> bandwidth.
>> 
>> What is the use case for this? Why is it specific to SPI-NOR
>> flashes? Or should it rather be an MTD "feature". I'm not sure
>> whether this is the right way to do it, thus I'd love to hear more
>> about the background story to this.
> 
> Well, our case is quite specific, but we wanted to provide a general
> solution for upstream. In our case we have a component in the data path
> that can cause a burst bit error, on average after about a hundred
> megabytes written.

Hmm. So, there is a serve hardware issue you're working around.

> We _could_ make it MTD-wide, in our case we only have a NOR Flash
> onboard so this is where we added it. If it were in the MTD core, where
> would it make sense?

I'm not so sure whether it makes sense at all.
In it's current form, there is no recovery. So anything non-trivial
on top of the MTD will just see an -EIO and has to give up.
E.g. a filesystem will remount read-only.

Thanks,
//richard



More information about the linux-mtd mailing list