linux/drivers/mtd
Brian Norris 9ce244b3fb mtd: support writing OOB without ECC
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: Brian Norris <computersforpeace@gmail.com>
Cc: Jim Quinlan <jim2101024@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-09-11 15:02:18 +03:00
..
chips mtd: cleanup style on pr_debug messages 2011-09-11 15:02:16 +03:00
devices mtd: cleanup style on pr_debug messages 2011-09-11 15:02:16 +03:00
lpddr mtd: remove duplicate assignment of chip->state 2011-05-25 02:11:13 +01:00
maps mtd: Kbuild: remove reference to MTD_PARTITIONS 2011-09-11 15:02:16 +03:00
nand mtd: support writing OOB without ECC 2011-09-11 15:02:18 +03:00
onenand mtd: cleanup style on pr_debug messages 2011-09-11 15:02:16 +03:00
tests mtd: tests: ignore corrected bitflips in OOB on mtd_readtest 2011-09-11 15:02:14 +03:00
ubi Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2011-07-22 19:02:39 -07:00
Kconfig mtd: remove CONFIG_MTD_DEBUG 2011-09-11 15:02:16 +03:00
Makefile mtd: make ofpart buildable as a separate module 2011-09-11 15:02:13 +03:00
afs.c mtd: abstract last MTD partition parser argument 2011-09-11 15:02:10 +03:00
ar7part.c mtd: abstract last MTD partition parser argument 2011-09-11 15:02:10 +03:00
cmdlinepart.c mtd: abstract last MTD partition parser argument 2011-09-11 15:02:10 +03:00
ftl.c mtd: spelling fixes 2011-09-11 15:02:16 +03:00
inftlcore.c mtd: cleanup style on pr_debug messages 2011-09-11 15:02:16 +03:00
inftlmount.c mtd: spelling fixes 2011-09-11 15:02:16 +03:00
mtd_blkdevs.c mtd: mtd_blkdevs: fix error path in blktrans_open 2011-05-25 01:53:45 +01:00
mtdblock.c mtd: replace DEBUG() with pr_debug() 2011-09-11 15:02:16 +03:00
mtdblock_ro.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
mtdchar.c mtd: support writing OOB without ECC 2011-09-11 15:02:18 +03:00
mtdconcat.c mtd: spelling fixes 2011-09-11 15:02:16 +03:00
mtdcore.c mtd: check parts pointer before using it 2011-09-11 15:02:18 +03:00
mtdcore.h mtd: hide parse_mtd_partitions 2011-09-11 15:02:13 +03:00
mtdoops.c Merge git://git.infradead.org/mtd-2.6 2011-01-17 11:15:30 -08:00
mtdpart.c mtd: remove put_partition_parser() from public header 2011-09-11 15:02:13 +03:00
mtdsuper.c mtd: replace DEBUG() with pr_debug() 2011-09-11 15:02:16 +03:00
mtdswap.c mtd: spelling fixes 2011-09-11 15:02:16 +03:00
nftlcore.c mtd: replace DEBUG() with pr_debug() 2011-09-11 15:02:16 +03:00
nftlmount.c mtd: spelling fixes 2011-09-11 15:02:16 +03:00
ofpart.c mtd: ofpart: add ofoldpart alias 2011-09-11 15:02:14 +03:00
redboot.c mtd: abstract last MTD partition parser argument 2011-09-11 15:02:10 +03:00
rfd_ftl.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
sm_ftl.c mtd: spelling fixes 2011-09-11 15:02:16 +03:00
sm_ftl.h mtd: sm_ftl: cosmetic, use bool when possible 2010-10-25 01:33:08 +01:00
ssfdc.c mtd: replace DEBUG() with pr_debug() 2011-09-11 15:02:16 +03:00