What if the UBI flasher can't skip all-FF pages?

Artem Bityutskiy dedekind1 at gmail.com
Tue Jan 18 03:56:34 EST 2011


On Fri, 2011-01-14 at 05:45 +0000, Jon Povey wrote:
> > A long initial boot is not really a problem.  I was seriously
> > considering this, but I realized that I could set up a platform
> > specific workaround.  My bootloader can write UBIFS correctly, so
> all
> > I need to do is reprogram every PEB in the UBI volume on the first
> > boot before attempting to
> > load Linux.
> 
> If that is a fresh mkfs.ubifs filesystem not many blocks will have a
> mix of all-FF and not-all-FF pages, you only need to rewrite those
> blocks.
> all-FF blocks I think you can just erase completely and UBI will put
> headers back on later (someone else may like to comment..)

Right.

> Bear in mind what happens if you lose power or get reset while doing
> this process. If you are planning to do it in the factory with a test
> after, shouldn't be a problem.

We have UBI atomic leb change function for this - it should take care of
power cuts. But it has some overhead - it calculates CRC32 of the data.

So basically, my idea was:

1. Add a bit to the EC header which tells: this PEB needs re-freshing.
2. After scanning and initializing, do 'ubi_eba_atomic_leb_change()' for
all LEBs which are mapped to PEBs with that flag.
3. 'ubi_eba_atomic_leb_change()' will atomically move the data to
another PEB and clean the flag.

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list