1. 21 5月, 2012 3 次提交
    • J
      UBI: modify ubi_wl_flush function to clear work queue for a lnum · 62f38455
      Joel Reardon 提交于
      This patch modifies ubi_wl_flush to force the erasure of
      particular volume id / logical eraseblock number pairs. Previous functionality
      is preserved when passing UBI_ALL for both values. The locations where ubi_wl_flush
      were called are appropriately changed: ubi_leb_erase only flushes for the
      erased LEB, and ubi_create_volume forces only flushing for its volume id.
      External code can call this new feature via the new function ubi_flush() added
      to kapi.c, which simply passes through to ubi_wl_flush().
      
      This was tested by disabling the call to do_work in ubi thread, which results
      in the work queue remaining unless explicitly called to remove. UBIFS was
      changed to call ubifs_leb_change 50 times for four different LEBs. Then the
      new function was called to clear the queue: passing wrong volume ids / lnum,
      correct ones, and finally UBI_ALL for both to ensure it was finally all
      cleard. The work queue was dumped each time and the selective removal
      of the particular LEB numbers was observed. Extra checks were enabled and
      ubifs's integck was also run. Finally, the drive was repeatedly filled and
      emptied to ensure that the queue was cleared normally.
      
      Artem: amended the patch.
      Signed-off-by: NJoel Reardon <reardonj@inf.ethz.ch>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      62f38455
    • A
      UBI: introduce UBI_ALL constant · 05a3cb7d
      Artem Bityutskiy 提交于
      Joel will use it in his 'ubi_flush()' extention to specify all eraseblocks.
      Also amend the comment for UBI_UNKNOWN - it is used beyond attaching info
      structure now.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      05a3cb7d
    • R
      UBI: Kill data type hint · b36a261e
      Richard Weinberger 提交于
      We do not need this feature and to our shame it even was not working
      and there was a bug found very recently.
      	-- Artem Bityutskiy
      
      Without the data type hint UBI2 (fastmap) will be easier to implement.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      b36a261e
  2. 23 6月, 2011 1 次提交
  3. 14 4月, 2011 1 次提交
  4. 08 3月, 2011 2 次提交
  5. 24 11月, 2009 1 次提交
  6. 02 6月, 2009 1 次提交
    • D
      UBI: add notification API · 0e0ee1cc
      Dmitry Pervushin 提交于
      UBI volume notifications are intended to create the API to get clients
      notified about volume creation/deletion, renaming and re-sizing. A
      client can subscribe to these notifications using 'ubi_volume_register()'
      and cancel the subscription using 'ubi_volume_unregister()'. When UBI
      volumes change, a blocking notifier is called. Clients also can request
      "added" events on all volumes that existed before client subscribed
      to the notifications.
      
      If we use notifications instead of calling functions like 'ubi_gluebi_xxx()',
      we can make the MTD emulation layer to be more flexible: build it as a
      separate module and load/unload it on demand.
      
      [Artem: many cleanups, rework locking, add "updated" event, provide
       device/volume info in notifiers]
      Signed-off-by: NDmitry Pervushin <dpervushin@embeddedalley.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      0e0ee1cc
  7. 24 7月, 2008 2 次提交
  8. 25 1月, 2008 1 次提交
  9. 27 12月, 2007 1 次提交
    • A
      UBI: add ubi_leb_map interface · 393852ec
      Artem Bityutskiy 提交于
      The idea of this interface belongs to Adrian Hunter. The
      interface is extremely useful when one has to have a guarantee
      that an LEB will contain all 0xFFs even in case of an unclean
      reboot. UBI does have an 'ubi_leb_erase()' call which may do
      this, but it is stupid and ineffecient, because it flushes whole
      queue. I should be re-worked to just be a pair of unmap,
      map calls.
      
      The user of the interfaci is UBIFS at the moment.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      393852ec
  10. 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