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

Daniel Ehrenberg dehrenberg at google.com
Wed Jan 14 10:08:51 PST 2015


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.

Dan

On Tue, Jan 13, 2015 at 11:47 PM, Ricard Wanderlof
<ricard.wanderlof at axis.com> wrote:
>
> On Wed, 14 Jan 2015, Dan Ehrenberg wrote:
>
>> Each partition on a device with bad blocks iterates over its erase
>> blocks to find an accurate count of bad blocks. The iteration can take
>> some time, especially on devices with many erase blocks which are
>> configured to use the OOB area to detect if the block is bad. This
>> patch makes a config option, MTD_PART_BAD_BLOCK_COUNT, which can
>> be turned off to skip the initial scan and forgo an accurate count.
>
> How much time would you actually save? Sure, there number of blocks in a
> modern flash is in the thousands, but one only has to read the OOB of the
> first page to find the bad block marker, so scanning through the whole
> flash does not take long.
>
> /Ricard
> --
> Ricard Wolf Wanderlöf                           ricardw(at)axis.com
> Axis Communications AB, Lund, Sweden            www.axis.com
> Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list