summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/smp.c
diff options
context:
space:
mode:
authorMatthieu CASTET <matthieu.castet@parrot.com>2012-10-19 17:29:33 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-11-15 14:37:51 +0100
commitcd409c61287b81d432024c1dbfad292304bf5df3 (patch)
treea6d6abff1ddcb4b2a03b85dcb10d889d8e75d80c /arch/sh/kernel/smp.c
parentmtd: sh_flctl: Add device tree support (diff)
downloadlinux-cd409c61287b81d432024c1dbfad292304bf5df3.tar.xz
linux-cd409c61287b81d432024c1dbfad292304bf5df3.zip
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>
Diffstat (limited to 'arch/sh/kernel/smp.c')
0 files changed, 0 insertions, 0 deletions