1. 04 9月, 2012 4 次提交
    • R
      UBI: allow specifying bad PEBs limit using module parameter · edac493d
      Richard Genoud 提交于
      This patch provides the possibility to adjust the "maximum expected number of
      bad blocks per 1024 blocks" (max_beb_per1024) for each mtd device.
      
      The majority of NAND devices have their max_beb_per1024 equal to 20, but
      sometimes it's more.
      Now, we can adjust that via a kernel parameter:
      ubi.mtd=<name|num|path>[,<vid_hdr_offs>[,max_beb_per1024]]
      Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      edac493d
    • 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
    • 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: 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
  2. 18 7月, 2012 1 次提交
  3. 21 5月, 2012 1 次提交
  4. 05 4月, 2011 1 次提交
    • A
      UBI: do not select KALLSYMS_ALL · 6bef0b67
      Artem Bityutskiy 提交于
      All UBI needs is to make sure we stacktraces when UBI debugging
      is enabled. It is enough to select KALLSYMS for this, KALLSYMS_ALL
      is not necessary.
      
      And the current Kconfig line we have:
      
      select KALLSYMS_ALL if KALLSYMS && DEBUG_KERNEL
      
      is just too complex to be sane and right. But this "if" part there
      is needed to prevent "unmet direct dependency" warnings, because
      KALLSYMS_ALL depends on KALLSYMS and DEBUG_KERNEL, so we cannot
      just select KALLSYMS_ALL.
      
      Anyway, this feels messy, and we do not seem to really need KALLSYMS_ALL,
      so select KALLSYMS instead.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Acked-by: NRandy Dunlap <randy.dunlap@oracle.com>
      6bef0b67
  5. 16 3月, 2011 1 次提交
    • A
      UBI: make tests modes dynamic · 28237e45
      Artem Bityutskiy 提交于
      Similarly to the debugging checks and message, make the test modes
      be dynamically selected via the "debug_tsts" module parameter or
      via the "/sys/module/ubi/parameters/debug_tsts" sysfs file. This
      is consistent with UBIFS as well.
      
      And now, since all the Kconfig knobs became dynamic, we can remove
      the Kconfig.debug file completely.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      28237e45
  6. 19 10月, 2010 1 次提交
  7. 07 5月, 2010 1 次提交
  8. 09 11月, 2009 1 次提交
  9. 03 6月, 2009 1 次提交
  10. 17 4月, 2008 1 次提交
  11. 27 4月, 2007 1 次提交
    • A
      UBI: Unsorted Block Images · 801c135c
      Artem B. Bityutskiy 提交于
      UBI (Latin: "where?") manages multiple logical volumes on a single
      flash device, specifically supporting NAND flash devices. UBI provides
      a flexible partitioning concept which still allows for wear-levelling
      across the whole flash device.
      
      In a sense, UBI may be compared to the Logical Volume Manager
      (LVM). Whereas LVM maps logical sector numbers to physical HDD sector
      numbers, UBI maps logical eraseblocks to physical eraseblocks.
      
      More information may be found at
      http://www.linux-mtd.infradead.org/doc/ubi.html
      
      Partitioning/Re-partitioning
      
        An UBI volume occupies a certain number of erase blocks. This is
        limited by a configured maximum volume size, which could also be
        viewed as the partition size. Each individual UBI volume's size can
        be changed independently of the other UBI volumes, provided that the
        sum of all volume sizes doesn't exceed a certain limit.
      
        UBI supports dynamic volumes and static volumes. Static volumes are
        read-only and their contents are protected by CRC check sums.
      
      Bad eraseblocks handling
      
        UBI transparently handles bad eraseblocks. When a physical
        eraseblock becomes bad, it is substituted by a good physical
        eraseblock, and the user does not even notice this.
      
      Scrubbing
      
        On a NAND flash bit flips can occur on any write operation,
        sometimes also on read. If bit flips persist on the device, at first
        they can still be corrected by ECC, but once they accumulate,
        correction will become impossible. Thus it is best to actively scrub
        the affected eraseblock, by first copying it to a free eraseblock
        and then erasing the original. The UBI layer performs this type of
        scrubbing under the covers, transparently to the UBI volume users.
      
      Erase Counts
      
        UBI maintains an erase count header per eraseblock. This frees
        higher-level layers (like file systems) from doing this and allows
        for centralized erase count management instead. The erase counts are
        used by the wear-levelling algorithm in the UBI layer. The algorithm
        itself is exchangeable.
      
      Booting from NAND
      
        For booting directly from NAND flash the hardware must at least be
        capable of fetching and executing a small portion of the NAND
        flash. Some NAND flash controllers have this kind of support. They
        usually limit the window to a few kilobytes in erase block 0. This
        "initial program loader" (IPL) must then contain sufficient logic to
        load and execute the next boot phase.
      
        Due to bad eraseblocks, which may be randomly scattered over the
        flash device, it is problematic to store the "secondary program
        loader" (SPL) statically. Also, due to bit-flips it may become
        corrupted over time. UBI allows to solve this problem gracefully by
        storing the SPL in a small static UBI volume.
      
      UBI volumes vs. static partitions
      
        UBI volumes are still very similar to static MTD partitions:
      
          * both consist of eraseblocks (logical eraseblocks in case of UBI
            volumes, and physical eraseblocks in case of static partitions;
          * both support three basic operations - read, write, erase.
      
        But UBI volumes have the following advantages over traditional
        static MTD partitions:
      
          * there are no eraseblock wear-leveling constraints in case of UBI
            volumes, so the user should not care about this;
          * there are no bit-flips and bad eraseblocks in case of UBI volumes.
      
        So, UBI volumes may be considered as flash devices with relaxed
        restrictions.
      
      Where can it be found?
      
        Documentation, kernel code and applications can be found in the MTD
        gits.
      
      What are the applications for?
      
        The applications help to create binary flash images for two purposes: pfi
        files (partial flash images) for in-system update of UBI volumes, and plain
        binary images, with or without OOB data in case of NAND, for a manufacturing
        step. Furthermore some tools are/and will be created that allow flash content
        analysis after a system has crashed..
      
      Who did UBI?
      
        The original ideas, where UBI is based on, were developed by Andreas
        Arnez, Frank Haverkamp and Thomas Gleixner. Josh W. Boyer and some others
        were involved too. The implementation of the kernel layer was done by Artem
        B. Bityutskiy. The user-space applications and tools were written by Oliver
        Lohmann with contributions from Frank Haverkamp, Andreas Arnez, and Artem.
        Joern Engel contributed a patch which modifies JFFS2 so that it can be run on
        a UBI volume. Thomas Gleixner did modifications to the NAND layer. Alexander
        Schmidt made some testing work as well as core functionality improvements.
      Signed-off-by: NArtem B. Bityutskiy <dedekind@linutronix.de>
      Signed-off-by: NFrank Haverkamp <haver@vnet.ibm.com>
      801c135c