1. 21 5月, 2012 15 次提交
  2. 09 3月, 2012 1 次提交
  3. 29 2月, 2012 1 次提交
  4. 21 9月, 2011 1 次提交
  5. 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
  6. 14 4月, 2011 1 次提交
  7. 31 3月, 2011 1 次提交
  8. 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
  9. 07 2月, 2011 2 次提交
  10. 03 12月, 2010 1 次提交
    • A
      UBI: fix corrupted PEB detection for NOR flash · 7ac760c2
      Artem Bityutskiy 提交于
      My new shiny code for corrupted PEB detection has NOR specific bug.
      We tread PEB as corrupted and preserve it, if
      
      1. EC header is OK.
      2. VID header is corrupted.
      3. data area is not "all 0xFFs"
      
      In case of NOR we have 'nor_erase_prepare()' quirk, which invalidates
      the headers before erasing the PEB. And we invalidate first the VID
      header, and then the EC header. So if a power cut happens after we have
      invalidated the VID header, but before we have invalidated the EC
      header, we end up with a PEB which satisfies the above 3 conditions,
      and the scanning code will treat it as corrupted, and will print
      scary warnings, wrongly.
      
      This patch fixes the issue by firt invalidating the EC header, then
      invalidating the VID header. In case of power cut inbetween, we still
      just lose the EC header, and UBI can deal with this situation gracefully.
      
      Thanks to Anatolij Gustschin <agust@denx.de> for tracking this down.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Reported-by: NAnatolij Gustschin <agust@denx.de>
      Tested-by: NAnatolij Gustschin <agust@denx.de>
      7ac760c2
  11. 19 11月, 2010 1 次提交
  12. 21 10月, 2010 3 次提交
  13. 19 10月, 2010 9 次提交
    • 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
    • A
      UBI: add truly corrupted PEBs to corrupted list · feeba4b8
      Artem Bityutskiy 提交于
      Start using the 'corr' list and add there PEBs which look truly corrupted,
      which means they have corrupted VID header and the data which follows the
      corrupted header does not contain all 0xFF bytes.
      
      At the moment, this does not change UBI functionality much because these
      PEBs will be erase when scanning finishes. But the plan is to teach UBI
      preserving them.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      feeba4b8
    • A
      UBI: do not put eraseblocks to the corrupted list unnecessarily · 0525dac9
      Artem Bityutskiy 提交于
      Currently UBI maintains 2 lists of PEBs during scanning:
      1. 'erase' list - PEBs which have no corruptions but should be erased
      2. 'corr' list - PEBs which have some corruptions and should be erased
      
      But we do not really need 2 lists for PEBs which should be erased after
      scanning is done - this is redundant. So this patch makes sure all PEBs
      which are corrupted are moved to the head of the 'erase' list. We add
      them to the head to make sure they are erased first and we get rid of
      corruption ASAP.
      
      However, we do not remove the 'corr' list and realted functions, because
      the plan is to use this list for other purposes. Namely, we plan to
      put eraseblocks with corruption which does not look like it was caused
      by unclean power cut. Then we'll preserve thes PEBs in order to avoid
      killing potentially valuable user data.
      
      This patch also amends PEBs accounting, because it was closely tight to
      the 'erase'/'corr' lists separation.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      0525dac9
    • A
      UBI: separate out corrupted list · 3fb34124
      Artem Bityutskiy 提交于
      This patch introduces 'add_corrupted()' function and separates out 'corr' list
      manipulation from the common 'add_to_list()' function. This is just a
      preparation for further changes - this patch does not change functionality.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      3fb34124
    • A
      UBI: change cascade of ifs to switch statements · b3321508
      Artem Bityutskiy 提交于
      This patch improves readability and simplifies scanning code by changing a
      long cascade of 'if' statements to a switch statement. This should presumably
      be a little faster as well.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      b3321508
    • A
      UBI: rename a local variable · e0e718c2
      Artem Bityutskiy 提交于
      Rename local variable 'ec_corr' into 'ec_err' to make the code a little bit
      more readable. 'ec_err' is more appropriate because it sounds more like 'error
      when EC was read' and it looks more logical because we use it together with
      'err'. Just a minor nicification which should improve the rather complex
      scanning code.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      e0e718c2
    • A
      UBI: handle bit-flips when no header found · 92e1a7d9
      Artem Bityutskiy 提交于
      Currently UBI has one small flaw - when we read EC or VID header, but find only
      0xFF bytes, we return UBI_IO_FF and do not report whether we had bit-flips or
      not. In case of the VID header, the scanning code adds this PEB to the free list,
      even though there were bit-flips.
      
      Imagine the following situation: we start writing VID header to a PEB and have a
      power cut, so the PEB becomes unstable. When we scan and read the PEB, we get
      a bit-flip. Currently, UBI would just ignore this and treat the PEB as free. This
      patch changes UBI behavior and now UBI will schedule this PEB for erasure.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      92e1a7d9
    • A
      UBI: remove duplicate IO error codes · 74d82d26
      Artem Bityutskiy 提交于
      The 'UBI_IO_PEB_EMPTY' and 'UBI_IO_PEB_FREE' are essentially the same
      and mean that there are only 0xFF bytes instead of headers. Simplify
      UBI a little by turning them into a single 'UBI_IO_FF' error code.
      
      Also, stop maintaining commentaries in 'ubi_io_read_vid_hdr()' which are
      almost identical to commentaries in 'ubi_io_read_ec_hdr()'.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      74d82d26
    • A
      UBI: rename IO error code · 756e1df1
      Artem Bityutskiy 提交于
      Rename UBI_IO_BAD_HDR_READ into UBI_IO_BAD_HDR_EBADMSG which is presumably more
      self-documenting and readable. Indeed, the '_READ' suffix does not tell much and
      even confuses, while '_EBADMSG' tells about uncorrectable ECC error, because we
      use -EBADMSG all over the place to represent ECC errors.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      756e1df1
  14. 30 8月, 2010 1 次提交
    • A
      UBI: fix forward compatibility · 80c1c16f
      Artem Bityutskiy 提交于
      Commit 0798cea8 "UBI: improve corrupted flash handling"
      broke delet-compatible volumes handling - it introduced a limit of 8 eraseblocks which
      may be corrupted. And delete-compatible eraseblocks are added to the "corrupted" list,
      so if we'd have a large delete-compatible volume, UBI would refuse it.
      
      The fix is to add delete-compatible volumes to the erase list instead. Indeed, they are
      corrupted, we just have to erase them.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      80c1c16f
  15. 02 8月, 2010 1 次提交