15 Nov, 2012
1 commit
-
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
Signed-off-by: Artem Bityutskiy
09 Oct, 2012
1 commit
-
UAPI Disintegration 2012-10-09
Conflicts:
MAINTAINERS
arch/arm/configs/bcmring_defconfig
arch/arm/mach-imx/clk-imx51-imx53.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/bcm_umi_nand.c
drivers/mtd/nand/nand_bcm_umi.h
drivers/mtd/nand/orion_nand.c
22 Aug, 2012
1 commit
-
Having missed the merge window, update to 3.6-rc2 to avoid conflicts with
new patches.Signed-off-by: David Woodhouse
21 Aug, 2012
1 commit
-
flush[_delayed]_work_sync() are now spurious. Mark them deprecated
and convert all users to flush[_delayed]_work().If you're cc'd and wondering what's going on: Now all workqueues are
non-reentrant and the regular flushes guarantee that the work item is
not pending or running on any CPU on return, so there's no reason to
use the sync flushes at all and they're going away.This patch doesn't make any functional difference.
Signed-off-by: Tejun Heo
Cc: Russell King
Cc: Paul Mundt
Cc: Ian Campbell
Cc: Jens Axboe
Cc: Mattia Dongili
Cc: Kent Yoder
Cc: David Airlie
Cc: Jiri Kosina
Cc: Karsten Keil
Cc: Bryan Wu
Cc: Benjamin Herrenschmidt
Cc: Alasdair Kergon
Cc: Mauro Carvalho Chehab
Cc: Florian Tobias Schandinat
Cc: David Woodhouse
Cc: "David S. Miller"
Cc: linux-wireless@vger.kernel.org
Cc: Anton Vorontsov
Cc: Sangbeom Kim
Cc: "James E.J. Bottomley"
Cc: Greg Kroah-Hartman
Cc: Eric Van Hensbergen
Cc: Takashi Iwai
Cc: Steven Whitehouse
Cc: Petr Vandrovec
Cc: Mark Fasheh
Cc: Christoph Hellwig
Cc: Avi Kivity
07 Jul, 2012
1 commit
-
We can clean up the loop logic a bit, here. This refactoring was enabled
in part by:Commit bb4a09866 [mtdoops: clean-up new MTD API usage]
Signed-off-by: Brian Norris
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
16 Jun, 2012
1 commit
-
Provide an iterator to receive the log buffer content, and convert all
kmsg_dump() users to it.The structured data in the kmsg buffer now contains binary data, which
should no longer be copied verbatim to the kmsg_dump() users.The iterator should provide reliable access to the buffer data, and also
supports proper log line-aware chunking of data while iterating.Signed-off-by: Kay Sievers
Tested-by: Tony Luck
Reported-by: Anton Vorontsov
Tested-by: Anton Vorontsov
Signed-off-by: Greg Kroah-Hartman
27 Mar, 2012
1 commit
-
Let's remove useless 'mtd_can_have_bb()' function invocations.
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
13 Jan, 2012
1 commit
-
KMSG_DUMP_KEXEC is useless because we already save kernel messages inside
/proc/vmcore, and it is unsafe to allow modules to do other stuffs in a
crash dump scenario.[akpm@linux-foundation.org: fix powerpc build]
Signed-off-by: WANG Cong
Reported-by: Vivek Goyal
Acked-by: Vivek Goyal
Acked-by: Jarod Wilson
Cc: "Eric W. Biederman"
Cc: KOSAKI Motohiro
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
10 Jan, 2012
11 commits
-
Instead, use the new 'mtd_can_have_bb()', or just rely on 'mtd_block_markbad()'
return code, which will be -EOPNOTSUPP if bad blocks are not supported.Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
This patch introduces new 'mtd_can_have_bb()' helper function which checks
whether the flash can have bad eraseblocks. Then it changes all the
direct 'mtd->block_isbad' use cases with 'mtd_can_have_bb()'.Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Instead of checking if 'mtd->panic_write' is defined, call 'mtd_panic_write()'
and check the error code - '-EOPNOTSUPP' will be returned if the function is
not defined.Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
This patch is part of a patch-set which changes the MTD interface
from 'mtd->func()' form to 'mtd_func()' form. We need this because
we want to add common code to to all drivers in the mtd core level,
which is impossible with the current interface when MTD clients
call driver functions like 'read()' or 'write()' directly.At this point we just introduce a new inline wrapper function, but
later some of them are expected to gain more code. E.g., the input
parameters check should be moved to the wrappers rather than be
duplicated at many drivers.This particular patch introduced the 'mtd_erase()' interface. The
following patches add all the other interfaces one by one.Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
The array of unsigned long pointed by oops_page_used is allocated
by vmalloc which requires the size to be in bytes.BITS_PER_LONG is equal to 32.
If we want to allocate memory for 32 pages with one bit per page then
32 / BITS_PER_LONG is equal to 1 byte that is 8 bits.
To fix it we need to multiply the result by sizeof(unsigned long) equal to 4.Cc: stable@kernel.org
Signed-off-by: Roman Tereshonkov
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Use block_isbad to check and skip the bad blocks reading.
This will allow to get rid of the read errors if bad blocks
are present initially.Cc: stable@kernel.org
Signed-off-by: Roman Tereshonkov
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
21 Sep, 2011
1 commit
-
Signed-off-by: Brian Norris
Signed-off-by: Artem Bityutskiy
18 Jan, 2011
1 commit
-
* git://git.infradead.org/mtd-2.6: (59 commits)
mtd: mtdpart: disallow reading OOB past the end of the partition
mtd: pxa3xx_nand: NULL dereference in pxa3xx_nand_probe
UBI: use mtd->writebufsize to set minimal I/O unit size
mtd: initialize writebufsize in the MTD object of a partition
mtd: onenand: add mtd->writebufsize initialization
mtd: nand: add mtd->writebufsize initialization
mtd: cfi: add writebufsize initialization
mtd: add writebufsize field to mtd_info struct
mtd: OneNAND: OMAP2/3: prevent regulator sleeping while OneNAND is in use
mtd: OneNAND: add enable / disable methods to onenand_chip
mtd: m25p80: Fix JEDEC ID for AT26DF321
mtd: txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max)
mtd: cfi_cmdset_0002: add support for Samsung K8D3x16UxC NOR chips
mtd: cfi_cmdset_0002: add support for Samsung K8D6x16UxM NOR chips
mtd: nand: ams-delta: drop omap_read/write, use ioremap
mtd: m25p80: add debugging trace in sst_write
mtd: nand: ams-delta: select for built-in by default
mtd: OneNAND: lighten scary initial bad block messages
mtd: OneNAND: OMAP2/3: add support for command line partitioning
mtd: nand: rearrange ONFI revision checking, add ONFI 2.3
...Fix up trivial conflict in drivers/mtd/Kconfig as per DavidW.
14 Jan, 2011
1 commit
-
This series aims to develop logging facility for enterprise use.
It is important to save kernel messages reliably on enterprise system
because they are helpful for diagnosing system.This series add kmsg_dump() to the paths loosing kernel messages. The use
case is the following.[Use case of reboot/poweroff/halt/emergency_restart]
My company has often experienced the followings in our support service.
- Customer's system suddenly reboots.
- Customers ask us to investigate the reason of the reboot.We recognize the fact itself because boot messages remain in
/var/log/messages. However, we can't investigate the reason why the
system rebooted, because the last messages don't remain. And off course
we can't explain the reason.We can solve above problem with this patch as follows.
Case1: reboot with command
- We can see "Restarting system with command:" or ""Restarting system.".Case2: halt with command
- We can see "System halted.".Case3: poweroff with command
- We can see " Power down.".Case4: emergency_restart with sysrq.
- We can see "Sysrq:" outputted in __handle_sysrq().Case5: emergency_restart with softdog.
- We can see "Initiating system reboot" in watchdog_fire().So, we can distinguish the reason of reboot, poweroff, halt and emergency_restart.
If customer executed reboot command, you may think the customer should
know the fact. However, they often claim they don't execute the command
when they rebooted system by mistake.No message remains on the current Linux kernel, so we can't show the proof
to the customer. This patch improves this situation.This patch:
Alters mtdoops and ramoops to perform their actions only for
KMSG_DUMP_PANIC, KMSG_DUMP_OOPS and KMSG_DUMP_KEXEC because they would
like to log crashes only.Signed-off-by: Seiji Aguchi
Cc: David Woodhouse
Cc: Marco Stornelli
Reviewed-by: Artem Bityutskiy
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
06 Jan, 2011
1 commit
-
flush_scheduled_work() is deprecated and scheduled to be removed.
Directly flush cxt->work_{erase|write} on removal instead.Signed-off-by: Tejun Heo
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
09 Aug, 2010
1 commit
-
Signed-off-by: David Woodhouse
25 Feb, 2010
1 commit
-
MAX_MTD_DEVICES is about to be removed.
Signed-off-by: Ben Hutchings
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
01 Jan, 2010
1 commit
-
crash_kexec gets called before kmsg_dump(KMSG_DUMP_OOPS) if
panic_on_oops is set, so the kernel log buffer is not stored
for this case.This patch adds a KMSG_DUMP_KEXEC dump type which gets called
when crash_kexec() is invoked. To avoid getting double dumps,
the old KMSG_DUMP_PANIC is moved below crash_kexec(). The
mtdoops driver is modified to handle KMSG_DUMP_KEXEC in the
same way as a panic.Signed-off-by: KOSAKI Motohiro
Acked-by: Simon Kagstrom
Signed-off-by: David Woodhouse
30 Nov, 2009
5 commits
-
The last messages which happens before a crash might contain interesting
information about the crash. This patch reworks mtdoops using the
kmsg_dumper support instead of a console, which simplifies the code and
also includes the messages before the oops started.On oops callbacks, the MTD device write is scheduled in a work queue (to
be able to use the regular mtd->write call), while panics call
mtd->panic_write directly. Thus, if panic_on_oops is set, the oops will
be written out during the panic.A parameter to specify which mtd device to use (number or name), as well
as a flag, writable at runtime, to toggle wheter to dump oopses or only
panics (since oopses can often be handled by regular syslog).The patch was massaged and amended by Artem.
Signed-off-by: Simon Kagstrom
Reviewed-by: Anders Grafstrom
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
The main justification for this is to allow catching long messages
during a panic, where the top part might otherwise be lost since moving
to the next block can require a flash erase.Signed-off-by: Simon Kagstrom
Reviewed-by: Anders Grafstrom
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Make the maximum mtdoops partition size to be 8MiB. Indeed, it does
not make sense to use anything larger than that anyway. This limit
makes it possible to catch stupid mistakes where the user gives e.g.,
a rootfs partition to mtdoops (which will happily erase it).Signed-off-by: Simon Kagstrom
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
This patch makes mtdoops keep track of used/unused pages in an array
instead of scanning the flash after a write. The advantage with this
approach is that it avoids calling mtd->read on a panic, which is not
possible for all mtd drivers.Signed-off-by: Simon Kagstrom
Reviewed-by: Anders Grafstrom
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
While looking into the mtdoops module, I've spotted several minor
imperfections. This patch addresses them. Namely:1. Remove several trailing white-spaces and tabs
2. Check 'vmalloc()' return code straight away, not several lines
below in the 'mtdoops_console_init()' function.
3. Clean up printks - make them more consistent and use the same
code formatting style for them.
4. Remove silly style of putting brackets around everything in
"if" operators.Signed-off-by: Artem Bityutskiy
Cc: Simon KagstromSigned-off-by: David Woodhouse
21 Mar, 2009
2 commits
-
- do not leave spin lock locked
- initialise spin lockSigned-off-by: Adrian Hunter
Acked-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
MTD's have both an index number and a name. Formerly,
the MTD selected for mtdoops was done only by index
number. With this patch, a name can be used instead.For example, the kernel command line:
console=ttyMTD5
selects MTD 5 for mtdoops. But now this is also possible:
console=ttyMTD,log
which selects the MTD named "log" for mtdoops.
This has the advantage that partitions can be added or
removed that would affect the MTD index number but not the
name, without having to then change the kernel command line.Signed-off-by: Adrian Hunter
Acked-by: Richard Purdie
Acked-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
10 Dec, 2008
1 commit
-
MTD internal API presently uses 32-bit values to represent
device size. This patch updates them to 64-bits but leaves
the external API unchanged. Extending the external API
is a separate issue for several reasons. First, no one
needs it at the moment. Secondly, whether the implementation
is done with IOCTLs, sysfs or both is still debated. Thirdly
external API changes require the internal API to be accepted
first.Note that although the MTD API will be able to support 64-bit
device sizes, existing drivers do not and are not required
to do so, although NAND base has been updated.In general, changing from 32-bit to 64-bit values cause little
or no changes to the majority of the code with the following
exceptions:
- printk message formats
- division and modulus of 64-bit values
- NAND base support
- 32-bit local variables used by mtdpart and mtdconcat
- naughtily assuming one structure maps to another
in MEMERASE ioctlSigned-off-by: Adrian Hunter
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
18 Oct, 2008
3 commits
-
This makes the driver erase a block when it doesn't find any
existing saved log messages which is safer than assuming the
flash was already erased.Signed-off-by: Richard Purdie
Signed-off-by: David Woodhouse -
Add a magic number to logged kernel oops messages so that they
can be more accurately detected rather than just having to rely
on the sequence number. This also allows easier detection of
saved crashes by userspace.Signed-off-by: Richard Purdie
Signed-off-by: David Woodhouse -
Fix an off by one error in the mtdoops driver
Signed-off-by: Richard Purdie
Signed-off-by: David Woodhouse
22 Apr, 2008
1 commit
-
struct oops_cxt needlessly became global.
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: David Woodhouse
07 Feb, 2008
2 commits
-
drivers/mtd/mtdoops.c: In function ‘mtdoops_console_sync’:
drivers/mtd/mtdoops.c:329: error: implicit declaration of function ‘in_interrupt’Signed-off-by: David Woodhouse
-
When the MTD provides a panic_write function, use it.
Signed-off-by: Richard Purdie
Signed-off-by: David Woodhouse