[PATCH] mtd: Add config option to skip scanning bad blocks in partitions

Brian Norris computersforpeace at gmail.com
Wed Jan 14 11:19:07 PST 2015


On Wed, Jan 14, 2015 at 10:08:51AM -0800, Daniel Ehrenberg wrote:
> To initialize the partitions, it takes me 3.5s with this config option
> turned on and .2s with the config option turned off. So a large
> proportion of the NAND startup time (not counting ubi coming up) is
> comes from this bad block scan. It takes about 1.87s to scan over the
> device, and I have my partitioning set up so there's an extra
> partition covering the whole device in addition to the individual
> partitions.

Why don't you have BBT enabled? Even if it's just in-memory (not
on-flash), you should only have to scan the entire flash once (not once
for each partition), after which every subsequent lookup should only be
a memory access. That'd cut your time in half already, I expect. But if
you use the on-flash BBT (NAND_BBT_USE_FLASH), then you should only have
to scan the flash once per flash lifetime, after which the bad block
information will be stored in just a few pages, and should take only a
millisecond or two to read.

(There are other reasons for using on-flash BBT, but I won't detail them
here.)

I also recall the bad block scanning process will read not just the
spare area, but actually the full 1st page. So that might cause a little
unnecessary slowness.

All in all, I think it's highly unlikely that your patch is necessary.
There are much better ways to get you a faster boot time.

Brian



More information about the linux-mtd mailing list