1. 04 9月, 2012 8 次提交
    • R
      UBI: use the whole MTD device size to get bad_peb_limit · ba4087e9
      Richard Genoud 提交于
      On NAND flash devices, UBI reserves some physical erase blocks (PEB) for
      bad block handling. Today, the number of reserved PEB can only be set as a
      percentage of the total number of PEB in each MTD partition. For example, for a
      NAND flash with 128KiB PEB, 2 MTD partition of 20MiB (mtd0) and 100MiB (mtd1)
      and 2% reserved PEB:
       - the UBI device on mtd0 will have 2 PEB reserved
       - the UBI device on mtd1 will have 16 PEB reserved
      
      The problem with this behaviour is that 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.
      Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      ba4087e9
    • R
      mtd: mtdparts: introduce mtd_get_device_size · 62082e56
      Richard Genoud 提交于
      'mtd_get_device_size()' returns the size of the whole MTD device, that is the
      mtd_info master size. This will be used by UBI to calculate the maximum number
      of bad blocks (MBB) on a MTD device.
      
      Artem: amended the patch a bit.
      Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      62082e56
    • R
      mtd: mark mtd_is_partition argument as constant · 5dee4674
      Richard Genoud 提交于
      'struct mtd_info' is not modified by 'mtd_is_partition()' so it can be marked
      as "const".
      Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      5dee4674
    • S
      UBI: kill CONFIG_MTD_UBI_BEB_RESERVE · 1b2a5790
      Shmulik Ladkani 提交于
      CONFIG_MTD_UBI_BEB_RESERVE and MIN_RESEVED_PEBS are no longer used,
      since the amount of reserved eraseblocks for bad PEB handling is now
      derived from 'ubi->bad_peb_limit' (ubi's maximum expected bad
      eraseblocks).
      Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
      1b2a5790
    • S
      UBI: limit amount of reserved eraseblocks for bad PEB handling · 37f758a0
      Shmulik Ladkani 提交于
      The existing mechanism of reserving PEBs for bad PEB handling has two
      flaws:
      - It is calculated as a percentage of good PEBs instead of total PEBs.
      - There's no limit on the amount of PEBs UBI reserves for future bad
        eraseblock handling.
      
      This patch changes the mechanism to overcome these flaws.
      
      The desired level of PEBs reserved for bad PEB handling (beb_rsvd_level)
      is set to the maximum expected bad eraseblocks (bad_peb_limit) minus the
      existing number of bad eraseblocks (bad_peb_count).
      
      The actual amount of PEBs reserved for bad PEB handling is usually set
      to the desired level (but in some circumstances may be lower than the
      desired level, e.g. when attaching to a device that has too few
      available PEBs to satisfy the desired level).
      
      In the case where the device has too many bad PEBs (above the expected
      limit), then the desired level, and the actual amount of PEBs reserved
      are set to zero. No PEBs will be set aside for future bad eraseblock
      handling - even if some PEBs are made available (e.g. by shrinking a
      volume).
      If another PEB goes bad, and there are available PEBs, then the
      eraseblock will be marked bad (consuming one available PEB). But if
      there are no available PEBs, ubi will go into readonly mode.
      Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com>
      37f758a0
    • S
      UBI: introduce new bad PEB limit · 8beeb3bb
      Shmulik Ladkani 提交于
      Introduce 'ubi->bad_peb_limit', which specifies an upper limit of PEBs
      UBI expects to go bad.  Currently, it is initialized to a fixed percentage
      of total PEBs in the UBI device (configurable via CONFIG_MTD_UBI_BEB_LIMIT).
      
      The 'bad_peb_limit' is intended to be used for calculating the amount of PEBs
      UBI needs to reserve for bad eraseblock handling.
      
      Artem: minor amendments.
      Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
      8beeb3bb
    • A
      183ae6cf
    • A
  2. 30 8月, 2012 12 次提交
  3. 29 8月, 2012 2 次提交
  4. 28 8月, 2012 1 次提交
  5. 25 8月, 2012 1 次提交
  6. 24 8月, 2012 3 次提交
  7. 23 8月, 2012 3 次提交
  8. 22 8月, 2012 10 次提交