linux-stable/drivers/mtd
Matthieu CASTET cd409c6128 mtdoops: don't erase flash at each boot
The current version on mtdoops erase first block of mtdoops partition at each
boot if there is no oops stored in flash. This can wear the flash.

When mtdoops start, find_next_position is called to find the next free entry in
the circular buffer. But if the flash is erased, find_next_position don't find
anything (maxcount == 0xffffffff) and start with the first entry after erasing it.

The scanning that is done in find_next_position already track free/used entries.
So if at the end of the scanning we don't find anything, we can start at the
first entry and erased the entry only if it is marked as used.
Most of this is implemented in mtdoops_inc_counter, so to avoid duplicating
code, if we don't find anything we set position to -1. mtdoops_inc_counter with
increment it, erase the entry if needed and start as before with nextpage = 0
and nextcount = 1).

Also during the scan phase, we use the MTDOOPS_KERNMSG_MAGIC to detect corruped
entries.

Signed-off-by: Matthieu Castet <matthieu.castet@parrot@com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15 15:37:51 +02:00
..
chips mtd: cfi_cmdset_0001: Fix problem with unlocking timeout 2012-09-29 15:29:08 +01:00
devices mtd: spear_smi: use module_platform_driver macro 2012-11-15 15:37:48 +02:00
lpddr mtd: lpddr: replace open-coded ARRAY_SIZE with macro 2012-05-13 22:47:31 -05:00
maps mtd: autcpu12-nvram: drop frees of devm_ alloc'd data 2012-09-29 15:33:36 +01:00
nand mtd: sh_flctl: Add device tree support 2012-11-15 15:37:50 +02:00
onenand mtd: onenand: Make flexonenand_set_boundary static 2012-11-09 17:02:50 +02:00
tests mtd: mtd_oobtest: printk -> pr_{info,err,crit} 2012-11-15 15:37:49 +02:00
ubi This pull request contains the UBI fastmap support implemented by Richard 2012-10-08 20:40:45 +09:00
afs.c
ar7part.c
bcm47xxpart.c mtd: bcm47part driver for BCM47XX chipsets 2012-09-29 15:32:31 +01:00
bcm63xxpart.c mtd: bcm63xxpart: handle Broadcom partition order 2012-05-13 22:55:03 -05:00
cmdlinepart.c mtd: cmdlinepart: Simplify parse_cmdline_partitions 2012-11-15 15:37:45 +02:00
ftl.c
inftlcore.c mtd: add leading underscore to all mtd functions 2012-03-27 00:20:01 +01:00
inftlmount.c
Kconfig mtd: bcm47part driver for BCM47XX chipsets 2012-09-29 15:32:31 +01:00
Makefile mtd: bcm47part driver for BCM47XX chipsets 2012-09-29 15:32:31 +01:00
mtd_blkdevs.c mtd: mtdblock: call mtd_sync() only if opened for write 2012-03-27 00:11:11 +01:00
mtdblock.c mtd: mtdblock: call mtd_sync() only if opened for write 2012-03-27 00:11:11 +01:00
mtdblock_ro.c
mtdchar.c mtd: Disable mtdchar mmap on MMU systems 2012-10-09 15:08:42 +01:00
mtdconcat.c mtd: unify initialization of erase_info->fail_addr 2012-03-27 01:02:24 +01:00
mtdcore.c UAPI Disintegration 2012-10-09 2012-10-09 15:04:25 +01:00
mtdcore.h
mtdoops.c mtdoops: don't erase flash at each boot 2012-11-15 15:37:51 +02:00
mtdpart.c UAPI Disintegration 2012-10-09 2012-10-09 15:04:25 +01:00
mtdsuper.c VFS: Pass mount flags to sget() 2012-07-14 16:38:34 +04:00
mtdswap.c
nftlcore.c mtd: nftlcore: remove out-of-date and now irrelevant piece of code 2012-03-27 00:24:03 +01:00
nftlmount.c
ofpart.c mtd: ofpart: Fix incorrect NULL check in parse_ofoldpart_partitions() 2012-11-15 15:37:46 +02:00
redboot.c mtd: redboot: remove useless code 2012-03-27 00:24:14 +01:00
rfd_ftl.c
sm_ftl.c mtd: kill MTD_NAND_VERIFY_WRITE 2012-09-29 15:00:46 +01:00
sm_ftl.h
ssfdc.c