UBI: calculation for max number of bad-blocks

Gupta, Pekon pekon at ti.com
Mon Jan 13 09:31:52 EST 2014


Hi Richard,

With reference to commit message:
	commit ba4087e956d336488c6df9dfca65d1e70cf480f1
	Author:     Richard Genoud <richard.genoud at gmail.com>
	UBI: use the whole MTD device size to get bad_peb_limit
-----------------
" NAND flash manufacturers give a
    minimum number of valid block (NVB) during the endurance life of the
    device, e.g.:

    Parameter             Symbol    Min    Max    Unit      Notes
    --------------------------------------------------------------
    Valid block number     NVB     1004    1024   Blocks     1

    From this number we can deduce the maximum number of bad PEB that a device will
    contain during its endurance life: a 128MiB NAND flash (1024 PEB) will not have
    less than 20 bad blocks during the flash endurance life.

    But the manufacturer doesn't tell where those bad block will appear. He doesn't
    say either if they will be equally disposed on the whole device (and I'm pretty
    sure they won't). So, according to the datasheets, we should reserve the
    maximum number of bad PEB for each UBI device (worst case scenario: 20 bad
    blocks appears on the smallest MTD partition).

    So this patch make UBI use the whole MTD device size to calculate the maximum
    bad expected eraseblocks.

    The Kconfig option is in per1024 blocks, thus it can have a default value of 20
    which is *very* common for NAND devices."
-----------------

I was not able to understand the need to do the convert 
Min.NVB (Minimum number of valid blocks) into a ratio of  'max_beb_per1024'.
Can't we just use " Max(bad-blocks) = Max(NVB) - Min(NVB)" ?
And make reserve_PEB > Max(bad-blocks) in UBI partitions, as all bad-blocks
can appear together in same partition itself.

with regards, pekon



More information about the linux-mtd mailing list