1. 07 2月, 2011 5 次提交
    • 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: cleanup comments about corrupted PEBs · fef2deb3
      Artem Bityutskiy 提交于
      Just make them a bit more readable and explanatory.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      fef2deb3
    • A
      UBI: add slab cache for ubi_scan_leb objects · 6c1e875c
      Artem Bityutskiy 提交于
      During scanning UBI allocates one struct ubi_scan_leb object for each PEB,
      so it can end up allocating thousands of them. Use slab cache to reduce
      memory consumption for these 48-byte objects, because currently used
      'kmalloc()' ends up allocating 64 bytes per object, instead of 48.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6c1e875c
    • 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
  2. 26 1月, 2011 3 次提交
  3. 07 12月, 2010 1 次提交
  4. 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
  5. 30 11月, 2010 1 次提交
  6. 19 11月, 2010 1 次提交
  7. 30 10月, 2010 3 次提交
  8. 29 10月, 2010 2 次提交
  9. 26 10月, 2010 6 次提交
  10. 25 10月, 2010 17 次提交