mtd: support reading OOB without ECC
authorBrian Norris <computersforpeace@gmail.com>
Wed, 31 Aug 2011 01:45:38 +0000 (18:45 -0700)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Sun, 11 Sep 2011 12:13:38 +0000 (15:13 +0300)
commitc46f6483d21e93400e4a110de7902830173d53b0
treebac45575c58963f4bc35d13b188c8ff5a32c9823
parente9195edc59f33e9cabdd32a2959e927806670f45
mtd: support reading OOB without ECC

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: Brian Norris <computersforpeace@gmail.com>
Cc: Jim Quinlan <jim2101024@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
drivers/mtd/mtdchar.c
drivers/mtd/nand/nand_base.c
include/linux/mtd/nand.h
This page took 0.028294 seconds and 5 git commands to generate.