linux/drivers
Thomas Gleixner 8593fbc68b [MTD] Rework the out of band handling completely
Hopefully the last iteration on this!

The handling of out of band data on NAND was accompanied by tons of fruitless
discussions and halfarsed patches to make it work for a particular
problem. Sufficiently annoyed by I all those "I know it better" mails and the
resonable amount of discarded "it solves my problem" patches, I finally decided
to go for the big rework. After removing the _ecc variants of mtd read/write
functions the solution to satisfy the various requirements was to refactor the
read/write _oob functions in mtd.

The major change is that read/write_oob now takes a pointer to an operation
descriptor structure "struct mtd_oob_ops".instead of having a function with at
least seven arguments.

read/write_oob which should probably renamed to a more descriptive name, can do
the following tasks:

- read/write out of band data
- read/write data content and out of band data
- read/write raw data content and out of band data (ecc disabled)

struct mtd_oob_ops has a mode field, which determines the oob handling mode.

Aside of the MTD_OOB_RAW mode, which is intended to be especially for
diagnostic purposes and some internal functions e.g. bad block table creation,
the other two modes are for mtd clients:

MTD_OOB_PLACE puts/gets the given oob data exactly to/from the place which is
described by the ooboffs and ooblen fields of the mtd_oob_ops strcuture. It's
up to the caller to make sure that the byte positions are not used by the ECC
placement algorithms.

MTD_OOB_AUTO puts/gets the given oob data automaticaly to/from the places in
the out of band area which are described by the oobfree tuples in the ecclayout
data structre which is associated to the devicee.

The decision whether data plus oob or oob only handling is done depends on the
setting of the datbuf member of the data structure. When datbuf == NULL then
the internal read/write_oob functions are selected, otherwise the read/write
data routines are invoked.

Tested on a few platforms with all variants. Please be aware of possible
regressions for your particular device / application scenario

Disclaimer: Any whining will be ignored from those who just contributed "hot
air blurb" and never sat down to tackle the underlying problem of the mess in
the NAND driver grown over time and the big chunk of work to fix up the
existing users. The problem was not the holiness of the existing MTD
interfaces. The problems was the lack of time to go for the big overhaul. It's
easy to add more mess to the existing one, but it takes alot of effort to go
for a real solution.

Improvements and bugfixes are welcome!

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2006-05-29 15:06:51 +02:00
..
acorn
acpi [PATCH] x86_64: Support memory hotadd without sparsemem 2006-04-09 11:53:16 -07:00
amba
atm [PATCH] Replace 0xff.. with correct DMA_xBIT_MASK 2006-03-28 09:16:07 -08:00
base [CLASS DEVICE]: add attribute_group creation 2006-05-06 17:55:11 -07:00
block [PATCH] USB: ub oops in block_uevent 2006-05-08 23:43:55 -07:00
bluetooth [PATCH] pcmcia: use bitfield instead of p_state and state 2006-03-31 17:26:33 +02:00
cdrom [PATCH] Overrun in cdrom/aztcd.c 2006-04-11 06:18:46 -07:00
char [PATCH] tpm_register_hardware gcc 4.1 warning fix 2006-05-15 11:20:57 -07:00
connector [PATCH] sem2mutex: drivers: raw, connector, dcdbas, ppp_generic 2006-03-23 07:38:10 -08:00
cpufreq [PATCH] x86_64: Move ondemand timer into own work queue 2006-05-08 09:34:56 -07:00
crypto
dio [PATCH] hp300: fix driver_register() return handling, remove dio_module_init() 2006-03-25 08:22:53 -08:00
edac [PATCH] EDAC Coexistence with BIOS 2006-05-03 20:05:41 -07:00
eisa [PATCH] EISA: Ignore generated file drivers/eisa/devlist.h 2006-03-25 08:23:01 -08:00
fc4
firmware [PATCH] DMI: move dmi_scan.c from arch/i386 to drivers/firmware/ 2006-04-14 11:41:25 -07:00
hwmon [PATCH] w83792d: Be quiet on misdetection 2006-04-14 11:18:33 -07:00
i2c [PATCH] scx200_acb: Fix for the CS5535 errata 2006-05-09 13:04:21 -07:00
ide [PATCH] ide_cs: Add IBM microdrive to known IDs 2006-05-15 11:20:58 -07:00
ieee1394 [PATCH] sbp2: fix spinlock recursion 2006-04-02 12:58:09 -07:00
infiniband IB: refcount race fixes 2006-05-12 14:57:52 -07:00
input Merge master.kernel.org:/home/rmk/linux-2.6-arm 2006-05-04 14:52:43 -07:00
isdn [PATCH] gigaset: endian fix 2006-05-15 11:20:57 -07:00
leds [PATCH] LED: Fix sysfs store function error handling 2006-05-15 11:20:56 -07:00
macintosh [PATCH] powerpc: fix oops in alsa powermac driver 2006-04-21 22:34:26 +10:00
mca
md [PATCH] md: Fix 'rdev->nr_pending' count when retrying barrier requests 2006-05-01 18:17:42 -07:00
media [ALSA] add __devinitdata to all pci_device_id 2006-04-27 21:10:34 +02:00
message [SCSI] mptfc: race between mptfc_register_dev and mptfc_target_alloc 2006-05-10 09:54:42 -05:00
mfd [PATCH] show MCP menu only on ARCH_SA1100 2006-03-24 07:33:28 -08:00
misc [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
mmc [MMC] Move set_ios debugging into mmc.c 2006-05-04 18:22:51 +01:00
mtd [MTD] Rework the out of band handling completely 2006-05-29 15:06:51 +02:00
net [PATCH] dl2k needs dma-mapping.h 2006-05-15 11:20:58 -07:00
nubus
oprofile [PATCH] mark f_ops const in the inode 2006-03-28 09:16:05 -08:00
parisc [PARISC] Document that we tolerate "Relaxed Ordering" 2006-04-21 22:20:33 +00:00
parport [PATCH] parport_pc: fix section mismatch warnings (v2) 2006-04-19 09:13:52 -07:00
pci [PATCH] smbus unhiding kills thermal management 2006-05-15 11:20:57 -07:00
pcmcia [PATCH] pcmcia Oopses fixes 2006-05-15 11:20:54 -07:00
pnp [PATCH] pnp: fix two messages in manager.c 2006-04-19 09:13:52 -07:00
rapidio
rtc [ARM] rtc-sa1100: fix compiler warnings and error cleanup 2006-05-06 11:29:21 +01:00
s390 [PATCH] s390: lcs incorrect test 2006-05-15 11:20:55 -07:00
sbus [SPARC]: Fix warning on prom_getproperty in openprom.c 2006-05-12 12:53:59 -07:00
scsi Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2006-05-11 15:34:33 -07:00
serial Merge master.kernel.org:/home/rmk/linux-2.6-serial 2006-05-11 15:46:42 -07:00
sh
sn [PATCH] Altix: correct ioc4 port order 2006-05-03 20:05:41 -07:00
spi
tc [PATCH] kill _INLINE_ 2006-03-23 07:38:16 -08:00
telephony [PATCH] pcmcia: use bitfield instead of p_state and state 2006-03-31 17:26:33 +02:00
usb [PATCH] USB: fix omninet driver bug 2006-05-12 11:58:10 -07:00
video [PATCH] Backlight/LCD Class: Fix sysfs _store error handling 2006-05-15 11:20:56 -07:00
w1 fix typos "wich" -> "which" 2006-03-24 18:23:14 +01:00
zorro [PATCH] amiga: fix driver_register() return handling, remove zorro_module_init() 2006-03-25 08:22:53 -08:00
Kconfig [IA64] IOC4 config option ordering 2006-04-21 10:59:00 -07:00
Makefile Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband 2006-04-02 12:51:22 -07:00