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

Richard Weinberger richard at nod.at
Wed Apr 16 11:41:18 PDT 2025


----- Ursprüngliche Mail -----
> Von: "Csókás Bence" <csokas.bence at prolan.hu>
>> 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.
> 
> In our case, we use UBIFS on top of UBI, which in this case chooses
> another eraseblock to hold the data instead, then re-tests (erase+write
> cycles) the one which gave -EIO. Since the bus error is only transient,
> it goes away by this time, and thus UBIFS will recover from this cleanly.

Are you sure about that?

I'd expect UBI to go into RO mode via a call path like:
ubi_eba_write_leb() -> ubi_io_write() -> mtd_write()
If mtd_write() returns an EIO, UBI will go into RO mode immediately.

(I'm assuming, your SPI-NOR has no bad block support, so ubi->bad_allowed
is false).

Thanks,
//richard



More information about the linux-mtd mailing list