On Wed, 6 May 2020 22:59:39 +0200 (CEST) Richard Weinberger <richard@xxxxxx> wrote: > ----- Ursprüngliche Mail ----- > >> UBI scans only headers during attach. If you don't touch these, no way. > > > > Sorry, I misunderstood what you meant by payload. UBI should schedule > > the PEB for erase if the EC/VID header is corrupted. > > UBI even tries to recover from such a situation. If only the EC header is bad, > it will create a new one. Only of the VID header is bad/missing and the payload > is corrupted (ECC errors or bit-flips) it will erase it. Yep, I remember that, though in the case of a corrupted EC, UBI will schedule a PEB recovery, and if the payload is corrupted, the read should fail when copying the LEB content to another block. > > A missing VID header plus good payload will cause UBI to stop attaching since it > violates the IO model. Sure, and that's not what we want to do anyway. We basically have 2 choices here: 1/ overwrite all pages starting from page 0 and ending at page 15. This will lead to ECC errors on already written pages, and 0-filled pages for others (unless we go for a raw write, in which case it might actually lead to ECC errors depending on the engine). 2/ track already written pages (by reading them first), and only writes those that have not been written yet. That means no ECC error in that case, and no corrupted EC/VID header as well. Clearly, #2 would help mitigate the perf penalty incurred by the Micron workaround, but if it's not an option, maybe we can just start with #1 (which is basically what Miquel implemented). ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/