1. 29 9月, 2012 1 次提交
  2. 17 7月, 2012 1 次提交
  3. 07 7月, 2012 2 次提交
  4. 09 6月, 2012 1 次提交
  5. 14 5月, 2012 13 次提交
  6. 27 3月, 2012 12 次提交
  7. 11 1月, 2012 1 次提交
  8. 10 1月, 2012 1 次提交
  9. 16 10月, 2011 1 次提交
    • B
      mtd: nand: initialize ops.mode · 23b1a99b
      Brian Norris 提交于
      Our `ops' information was converted to a local variable recently, and
      apparently, old code relied on the fact that the global version was
      often left in a valid mode. We can't make this assumption on local
      structs, and we shouldn't be relying on a previous state anyway.
      
      Instead, we initialize mode to 0 for don't-care situations (i.e., the
      operation does not use OOB anyway) and MTD_OPS_PLACE_OOB when we want to
      place OOB data.
      
      This fixes a bug with nand_default_block_markbad(), where we catch on
      the BUG() call in nand_fill_oob():
      
      Kernel bug detected[#1]:
      ...
      Call Trace:
      [<80307350>] nand_fill_oob.clone.5+0xa4/0x15c
      [<803075d8>] nand_do_write_oob+0x1d0/0x260
      [<803077c4>] nand_default_block_markbad+0x15c/0x1a8
      [<802e8c2c>] part_block_markbad+0x80/0x98
      [<802ebc74>] mtd_ioctl+0x6d8/0xbd0
      [<802ec1a4>] mtd_unlocked_ioctl+0x38/0x5c
      [<800d9c60>] do_vfs_ioctl+0xa4/0x6e4
      [<800da2e4>] sys_ioctl+0x44/0xa0
      [<8001381c>] stack_done+0x20/0x40
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      23b1a99b
  10. 21 9月, 2011 1 次提交
    • B
      mtd: nand: invalidate cache on unaligned reads · 6d77b9d0
      Brian Norris 提交于
      In rare cases, we are given an unaligned parameter `from' in
      `nand_do_read_ops()'. In such cases, we use the page cache
      (chip->buffers->databuf) as an intermediate buffer before dumping to the
      client buffer. However, there are also cases where this buffer is not
      cleanly reusable. In those cases, we need to make sure that we
      explicitly invalidate the cache.
      
      This patch prevents accidental reusage of the page cache, and for me,
      this solves some problems I come across when reading a corrupted BBT
      from flash (NAND_BBT_USE_FLASH and NAND_BBT_NO_OOB).
      
      Note: the rare "unaligned" case is a result of the extra BBT pattern +
      version located in the data area instead of OOB.
      
      Also, this patch disables caching on raw reads, since we are reading
      without error correction. This is, obviously, prone to errors and should
      not be cached.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      6d77b9d0
  11. 11 9月, 2011 6 次提交
    • B
      mtd: nand: kill member `ops' of `struct nand_chip' · 4a89ff88
      Brian Norris 提交于
      The nand_chip.ops field is a struct that is passed around globally with
      no particular reason. Every time it is used, it could just as easily be
      replaced with a local struct that is updated on each operation. So make
      it local.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      4a89ff88
    • B
      mtd: rename MTD_OOB_* to MTD_OPS_* · 0612b9dd
      Brian Norris 提交于
      These modes are not necessarily for OOB only. Particularly, MTD_OOB_RAW
      affected operations on in-band page data as well. To clarify these
      options and to emphasize that their effect is applied per-operation, we
      change the primary prefix to MTD_OPS_.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      0612b9dd
    • B
      mtd: support reading OOB without ECC · c46f6483
      Brian Norris 提交于
      This fixes issues with `nanddump -n' and the MEMREADOOB[64] ioctls on
      hardware that performs error correction when reading only OOB data. A
      driver for such hardware needs to know when we're doing a RAW vs. a
      normal write, but mtd_do_read_oob does not pass such information to the
      lower layers (e.g., NAND). We should pass MTD_OOB_RAW or MTD_OOB_PLACE
      based on the MTD file mode.
      
      For now, most drivers can get away with just setting:
      
        chip->ecc.read_oob_raw = chip->ecc.read_oob
      
      This is done by default; but for systems that behave as described above,
      you must supply your own replacement function.
      
      This was tested with nandsim as well as on actual SLC NAND.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Cc: Jim Quinlan <jim2101024@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      c46f6483
    • B
      mtd: support writing OOB without ECC · 9ce244b3
      Brian Norris 提交于
      This fixes issues with `nandwrite -n -o' and the MEMWRITEOOB[64] ioctls
      on hardware that writes ECC when writing OOB. The problem arises as
      follows: `nandwrite -n' can write page data to flash without applying
      ECC, but when used with the `-o' option, ECC is applied (incorrectly),
      contrary to the `--noecc' option.
      
      I found that this is the case because my hardware computes and writes
      ECC data to flash upon either OOB write or page write. Thus, to support
      a proper "no ECC" write, my driver must know when we're performing a raw
      OOB write vs. a normal ECC OOB write. However, MTD does not pass any raw
      mode information to the write_oob functions.  This patch addresses the
      problems by:
      
      1) Passing MTD_OOB_RAW down to lower layers, instead of just defaulting
         to MTD_OOB_PLACE
      2) Handling MTD_OOB_RAW within the NAND layer's `nand_do_write_oob'
      3) Adding a new (replaceable) function pointer in struct ecc_ctrl; this
         function should support writing OOB without ECC data. Current
         hardware often can use the same OOB write function when writing
         either with or without ECC
      
      This was tested with nandsim as well as on actual SLC NAND.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Cc: Jim Quinlan <jim2101024@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      9ce244b3
    • B
      mtd: replace DEBUG() with pr_debug() · 289c0522
      Brian Norris 提交于
      Start moving away from the MTD_DEBUG_LEVEL messages. The dynamic
      debugging feature is a generic kernel feature that provides more
      flexibility.
      
      (See Documentation/dynamic-debug-howto.txt)
      
      Also fix some punctuation, indentation, and capitalization that went
      along with the affected lines.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      289c0522
    • B
      mtd: nand: style fixups in pr_* messages · d0370219
      Brian Norris 提交于
      This is a cleanup of some punctuation, indentation, and capitalization
      on the lines affected affected by the last patch.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      d0370219