1. 10 1月, 2014 1 次提交
    • Q
      UBI: avoid program operation on NOR flash after erasure interrupted · 2c7ca5cc
      Qi Wang 王起 (qiwang) 提交于
      nor_erase_prepare() will be called before erase a NOR flash, it will program '0'
      into a block to mark this block. But program data into a erasure interrupted block
      can cause program timtout(several minutes at most) error, could impact other
      operation on NOR flash. So UBIFS can read this block first to avoid unneeded
      program operation.
      
      This patch try to put read operation at head of write operation in
      nor_erase_prepare(), read out the data.
      If the data is already corrupt, then no need to program any data into this block,
      just go to erase this block.
      
      This patch is validated on Micron NOR flash, part number is:JS28F512M29EWHA
      Signed-off-by: NQi Wang <qiwang@micron.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      2c7ca5cc
  2. 10 12月, 2012 1 次提交
  3. 04 9月, 2012 2 次提交
  4. 21 5月, 2012 9 次提交
  5. 09 3月, 2012 1 次提交
  6. 10 1月, 2012 5 次提交
  7. 21 9月, 2011 1 次提交
  8. 01 6月, 2011 2 次提交
  9. 14 4月, 2011 2 次提交
  10. 05 4月, 2011 1 次提交
  11. 24 3月, 2011 1 次提交
  12. 16 3月, 2011 4 次提交
    • 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
    • A
      UBI: remove UBI_IO_DEBUG macro · 6f9fdf62
      Artem Bityutskiy 提交于
      This additional little macro is used to print a bit more messages
      while scanning the media. However, we have the 'dbg_bld()' macro
      for this, so we better us 'dbg_bld()' and kill UBI_IO_DEBUG. This
      simplifies the code a tiny bit.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6f9fdf62
    • A
      UBI: allocate erase checking buffer on demand · 332873d6
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'ubi->dbg_peb_buf' buffer in
      'ubi_dbg_check_all_ff()', dynamically allocate it when needed. The
      intend is to get rid of the pre-allocated 'ubi->dbg_peb_buf' buffer
      completely. And the need for this arises because we want to change
      to dynamic debugging control instead of compile-time control, i.e.,
      we are going to kill the CONFIG_MTD_UBI_DEBUG_PARANOID Kconfig
      option, which would mean that 'ubi->dbg_peb_buf' is always allocated,
      which would be wasteful.
      
      Thus, we are getting rid of 'ubi->dbg_peb_buf', and this is a
      preparation for that.
      signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      332873d6
    • A
      UBI: allocate write checking buffer on demand · a7586743
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'ubi->dbg_peb_buf' buffer in
      'ubi_dbg_check_write()', dynamically allocate it when needed. The
      intend is to get rid of the pre-allocated 'ubi->dbg_peb_buf' buffer
      completely. And the need for this arises because we want to change
      to dynamic debugging control instead of compile-time control, i.e.,
      we are going to kill the CONFIG_MTD_UBI_DEBUG_PARANOID Kconfig
      option, which would mean that 'ubi->dbg_peb_buf' is always allocated,
      which would be wasteful.
      
      Thus, we are getting rid of 'ubi->dbg_peb_buf', and this is a
      preparation for that.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      a7586743
  13. 07 2月, 2011 3 次提交
    • A
      UBI: always re-read in case of read failures · a87f29cb
      Artem Bityutskiy 提交于
      When the read operation fails, UBI tries to re-read several times in
      a hope that one of the subsequent reads may succeed. However, currently
      UBI re-reads only if MTD failed to read all data, but does not re-reads
      if all the data were read, but with an integrity error (-EBADMSB). This
      patch makes UBI to always re-try reading.
      
      This should be useful for reading NAND pages with unstable bits -
      re-reading may help to get correct data.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      a87f29cb
    • A
      UBI: use raw mtd read function in debugging code · 7950d023
      Artem Bityutskiy 提交于
      This change affects only the debugging code. Namely, use mtd->read()
      function instead of ubi_io_read() to avoid bit-flips injection
      (ubi_dbg_is_bitflip()) which we do not want on the debugging path.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      7950d023
    • A
      UBI: try to reveal buggy MTD drivers · 276832d8
      Artem Bityutskiy 提交于
      When reading data from the flash, corrupt the buffer we are about to
      read to. The idea is to fix the following possible situation:
      
      1. The buffer contains data from previous operation, e.g., read from
         another PEB previously. The data looks like expected, e.g., if we
         just do not read anything and return - the caller would not
         notice this. E.g., if we are reading a VID header, the buffer may
         contain a valid VID header from another PEB.
      2. The driver is buggy and returns use success or -EBADMSG or
         -EUCLEAN, but it does not actually put any data to the buffer.
      
      This may confuse UBI or upper layers - they may think the buffer
      contains valid data while in fact it is just old data.
      
      Thus, try to reveal such buggy MTD drivers with simple debugging
      code which fills the read buffer with 0x12 constant.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      276832d8
  14. 26 1月, 2011 2 次提交
  15. 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
  16. 19 10月, 2010 4 次提交
    • A
      UBI: make check_pattern function non-static · bb00e180
      Artem Bityutskiy 提交于
      This patch turns static function 'check_pattern()' into a non-static
      'ubi_check_pattern()'. This is just a preparation for the chages which
      are coming in the next patches.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      bb00e180
    • 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