1. 21 5月, 2012 6 次提交
    • 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: get rid of dbg_err · e2986827
      Artem Bityutskiy 提交于
      This patch removes the 'dbg_err()' macro and we now use 'ubi_err' instead.
      The idea of 'dbg_err()' was to compile out some error message to make the
      binary a bit smaller - but I think it was a bad idea.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      e2986827
    • A
      UBI: more of clean-up terminology for self-checks · 7bf523ae
      Artem Bityutskiy 提交于
      We have the "sefl-check" feature in UBI, but for historical reasons many
      corresponding functions and commentaries in the code use term "paranoid check"
      instead. Let's clean this up and use "self-check" everywhere.
      
      This patch renames functions, amends messages and kills several redundant
      debugging messages.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      7bf523ae
    • A
      UBI: remove Kconfig debugging option · aa44d1d3
      Artem Bityutskiy 提交于
      This patch kills the UBI debugging Kconfig option completely and makes all the
      debugging stuff to be always compiled-in. It was pain in the neck to maintain
      this useless option because all users I am aware of have debugging enabled
      anyway - how else will you diagnose errors otherwise?
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      aa44d1d3
    • A
      UBI: rename ubi_dbg_dump_vtbl_record · 1f021e1d
      Artem Bityutskiy 提交于
      I am going to remove the "UBI debugging" compilation option and make the
      debugging stuff to be always compiled it. This patch is a preparation
      which renames 'ubi_dbg_dump_vtbl_record()' to 'ubi_dump_vtbl_record()'.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      1f021e1d
    • A
      UBI: rename ubi_dbg_dump_vol_info · 766381f0
      Artem Bityutskiy 提交于
      I am going to remove the "UBI debugging" compilation option and make the
      debugging stuff to be always compiled it. This patch is a preparation
      which renames 'ubi_dbg_dump_vol_info()' to 'ubi_dump_vol_info()'.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      766381f0
  2. 01 11月, 2011 1 次提交
  3. 01 6月, 2011 1 次提交
    • A
      UBI: use debugfs for the extra checks knobs · 2a734bb8
      Artem Bityutskiy 提交于
      This patch introduces debugfs support to UBI. All the UBI stuff is kept in the
      "ubi" debugfs directory, which contains per-UBI device "ubi/ubiX"
      sub-directories, containing debugging files. This file also creates
      "ubi/ubiX/chk_gen" and "ubi/ubiX/chk_io" knobs for switching general and I/O
      extra checks on and off. And it removes the 'debug_chks' UBI module parameters.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      2a734bb8
  4. 05 4月, 2011 1 次提交
  5. 16 3月, 2011 1 次提交
    • A
      UBI: make self-checks dynamic · 92d124f5
      Artem Bityutskiy 提交于
      This patch adds a possibility to dynamically switch UBI self-checks
      on and off, instead of toggling them compile-time from the configuration
      menu. This is much more flexible, and consistent with UBIFS, and this
      also simplifies UBI Kconfig menu and the code.
      
      This patch introduces two levels of self-checks - general, which
      includes all self-checks which are relatively fast, and I/O, which
      includes write-verify checks and erase-verify checks, which are
      relatively slow and involve flash I/O.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      92d124f5
  6. 19 10月, 2010 1 次提交
    • A
      UBI: preserve corrupted PEBs · 5fc01ab6
      Artem Bityutskiy 提交于
      Currently UBI erases all corrupted eraseblocks, irrespectively of the nature
      of corruption: corruption due to power cuts and non-power cut corruption.
      The former case is OK, but the latter is not, because UBI may destroy
      potentially important data.
      
      With this patch, during scanning, when UBI hits a PEB with corrupted VID
      header, it checks whether this PEB contains only 0xFF data. If yes, it is
      safe to erase this PEB and it is put to the 'erase' list. If not, this may
      be important data and it is better to avoid erasing this PEB. Instead,
      UBI puts it to the corr list and moves out of the pool of available PEB.
      IOW, UBI preserves this PEB.
      
      Such corrupted PEB lessen the amount of available PEBs. So the more of them
      we accumulate, the less PEBs are available. The maximum amount of non-power
      cut corrupted PEBs is 8.
      
      This patch is a response to UBIFS problem where reporter
      (Matthew L. Creech <mlcreech@gmail.com>) observes that UBIFS index points
      to an unmapped LEB. The theory is that corresponding PEB somehow got
      corrupted and UBI wiped it. This patch (actually a series of patches)
      tries to make sure such PEBs are preserved - this would make it is easier
      to analyze the corruption.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      5fc01ab6
  7. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  8. 02 6月, 2009 2 次提交
  9. 18 5月, 2009 4 次提交
  10. 18 1月, 2009 1 次提交
  11. 07 1月, 2009 1 次提交
  12. 23 12月, 2008 1 次提交
  13. 24 7月, 2008 8 次提交
  14. 04 3月, 2008 1 次提交
  15. 25 1月, 2008 2 次提交
    • A
      UBI: add auto-resize feature · 4ccf8cff
      Artem Bityutskiy 提交于
      The problem: NAND flashes have different amount of initial bad physical
      eraseblocks (marked as bad by the manufacturer). For example, for 256MiB
      Samsung OneNAND flash there might be from 0 to 40 bad initial eraseblocks,
      which is about 2%. When UBI is used as the base system, one needs to know
      the exact amount of good physical eraseblocks, because this number is
      needed to create the UBI image which is put to the devices during
      production. But this number is not know, which forces us to use the
      minimum number of good physical eraseblocks. And UBI additionally
      reserves some percentage of physical eraseblocks for bad block handling
      (default is 1%), so we have 1-3% of PEBs reserved at the end, depending
      on the amount of initial bad PEBs. But it is desired to always have
      1% (or more, depending on the configuration).
      
      Solution: this patch adds an "auto-resize" flag to the volume table.
      The volume which has the "auto-resize" flag will automatically be re-sized
      (enlarged) on the first UBI initialization. UBI clears the flag when
      the volume is re-sized. Only one volume may have the "auto-resize" flag.
      
      So, the production UBI image may have one volume with "auto-resize"
      flag set, and its size is automatically adjusted on the first boot
      of the device.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      4ccf8cff
    • A
      UBI: use bit-fields · 896c0c06
      Artem Bityutskiy 提交于
      Save 12 bytes of RAM per volume by using bit-fields instead of integers.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      896c0c06
  16. 27 12月, 2007 8 次提交