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

    Matthieu CASTET
     

09 Oct, 2012

1 commit


22 Aug, 2012

1 commit


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

    Tejun Heo
     

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

    Brian Norris
     

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

    Kay Sievers
     

27 Mar, 2012

1 commit


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

    WANG Cong
     

10 Jan, 2012

11 commits


21 Sep, 2011

1 commit


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.

    Linus Torvalds
     

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

    Seiji Aguchi
     

06 Jan, 2011

1 commit


09 Aug, 2010

1 commit


25 Feb, 2010

1 commit


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

    KOSAKI Motohiro
     

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

    Simon Kagstrom
     
  • 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

    Simon Kagstrom
     
  • 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

    Simon Kagstrom
     
  • 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

    Simon Kagstrom
     
  • 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 Kagstrom

    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     

21 Mar, 2009

2 commits

  • - do not leave spin lock locked
    - initialise spin lock

    Signed-off-by: Adrian Hunter
    Acked-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Adrian Hunter
     
  • 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

    Adrian Hunter
     

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 ioctl

    Signed-off-by: Adrian Hunter
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Adrian Hunter
     

18 Oct, 2008

3 commits


22 Apr, 2008

1 commit


07 Feb, 2008

2 commits