06 Aug, 2020

1 commit

  • Add module parameters 'soft_reboot_cmd' and 'soft_active_on_boot' for
    customizing softdog configuration; config reboot command by assigning
    soft_reboot_cmd, and set soft_active_on_boot to start up softdog
    timer at module initialization stage.

    Signed-off-by: Woody Lin
    Reviewed-by: Guenter Roeck
    Link: https://lore.kernel.org/r/20200708083218.3157213-1-woodylin@google.com
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Woody Lin
     

09 Jul, 2019

1 commit


01 Mar, 2017

1 commit

  • Checking for timer expiration is done from the softirq TIMER_SOFTIRQ.

    Since commit 4cd13c21b207 ("softirq: Let ksoftirqd do its job"),
    pending softirqs are no longer always handled immediately, instead,
    if there are pending softirqs, and ksoftirqd is in state TASK_RUNNING,
    the handling of the softirqs are deferred, and are instead supposed
    to be handled by ksoftirqd, when ksoftirqd gets scheduled.

    If a user space process with a real-time policy starts to misbehave
    by never relinquishing the CPU while ksoftirqd is in state TASK_RUNNING,
    what will happen is that all softirqs will get deferred, while ksoftirqd,
    which is supposed to handle the deferred softirqs, will never get to run.

    To make sure that the watchdog is able to fire even when we do not get
    to run softirqs, replace the timers with hrtimers.

    Signed-off-by: Niklas Cassel
    Signed-off-by: Guenter Roeck

    Niklas Cassel
     

25 Feb, 2017

1 commit

  • It occurred to me that the panic pretimeout governor will stall the
    softdog, because it is purely software which simply breaks when the
    kernel panics. Testing governors with the softdog on the other hand is
    really useful, so make this feature a compile time option which nees to
    be enabled explicitly. This also removes the overhead if pretimeout
    support is not used because it will now be compiled away (saving ~10% on
    ARM32).

    Signed-off-by: Wolfram Sang
    Reviewed-by: Vladimir Zapolskiy
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck

    Wolfram Sang
     

08 Oct, 2016

1 commit


24 Sep, 2016

1 commit

  • Check for watchdog_ops structures that are only stored in the ops field of
    a watchdog_device structure. This field is declared const, so watchdog_ops
    structures that have this property can be declared as const also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct watchdog_ops i@p = { ... };

    @ok@
    identifier r.i;
    struct watchdog_device e;
    position p;
    @@
    e.ops = &i@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct watchdog_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct watchdog_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Julia Lawall
     

18 Jul, 2016

7 commits


28 Dec, 2015

1 commit

  • the softdog has static variables which are accessed if its timer is
    still running after the driver is unloaded. and lead to crash:

    $modprobe softdog
    $echo 1 >/dev/watchdog
    $modprobe -r softdog

    CPU 20 Unable to handle kernel paging request at virtual address
    Oops[#1]:
    CPU: 20 PID: 0 Comm: swapper/20 Not tainted 4.1.13-WR8.0.0.0_standard
    ...
    Modules linked in: [last unloaded: softdog]
    ....
    Call Trace:
    [] cascade+0x34/0xb0
    [] run_timer_softirq+0x30c/0x368
    [] __do_softirq+0x1ec/0x418
    [] irq_exit+0x90/0x98
    [] plat_irq_dispatch+0xa4/0x140
    [] ret_from_irq+0x0/0x4
    [] __r4k_wait+0x20/0x40
    [] cpu_startup_entry+0x2a0/0x368
    [] start_secondary+0x444/0x4d8

    add the module ref when timer is running to avoid to unload the softdog
    module

    Signed-off-by: Li RongQing
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Li RongQing
     

13 Dec, 2015

1 commit


31 Mar, 2014

1 commit

  • Fix the following checkpatch warnings and error:
    WARNING: quoted string split across lines
    WARNING: braces {} are not necessary for single statement blocks
    WARNING: __initdata should be placed after ibmasr_id_table[]
    WARNING: please, no space before tabs
    ERROR: do not initialise statics to 0 or NULL

    Signed-off-by: Jingoo Han
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Jingoo Han
     

10 Dec, 2013

1 commit


18 Nov, 2013

1 commit

  • I just can't find any value in MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR)
    and MODULE_ALIAS_MISCDEV(TEMP_MINOR) statements.

    Either the device is enumerated and the driver already has a module
    alias (e.g. PCI, USB etc.) that will get the right driver loaded
    automatically.

    Or the device is not enumerated and loading its driver will lead to
    more or less intrusive hardware poking. Such hardware poking should be
    limited to a bare minimum, so the user should really decide which
    drivers should be tried and in what order. Trying them all in
    arbitrary order can't do any good.

    On top of that, loading that many drivers at once bloats the kernel
    log. Also many drivers will stay loaded afterward, bloating the output
    of "lsmod" and wasting memory. Some modules (cs5535_mfgpt which gets
    loaded as a dependency) can't even be unloaded!

    If defining char-major-10-130 is needed then it should happen in
    user-space.

    Signed-off-by: Jean Delvare
    Acked-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck
    Cc: Stephen Warren
    Cc: Mike Frysinger
    Cc: Wan ZongShun
    Cc: Ben Dooks
    Cc: Kukjin Kim
    Cc: Zwane Mwaikambo
    Cc: Jim Cromie

    Jean Delvare
     

12 Jul, 2013

1 commit


28 Mar, 2012

3 commits


29 Mar, 2011

1 commit

  • This is needed for determining the reason for failure when a softdog
    timeout occurs.

    We use softdog to watch for critical application failures and at the
    minimum a snapshot of the system would help to determine the cause. In
    such a scenario the application could fail but there isn't a softlockup as
    such, hence the detect softlockup feature does not help.

    The patch adds a module parameter soft_panic which when set to 1 causes
    softdog to invoke panic instead of reboot when the softdog timer expires.
    By invoking panic we execute kdump if it is configured and the vmcore
    generated by kdump should provide atleast a minimal idea of the reason for
    failure.

    Based on an original patch by Ken Sugawara
    Signed-off-by: Anithra P J
    Reviewed-by: WANG Cong
    Acked-by: Alan Cox
    Signed-off-by: Wim Van Sebroeck
    Signed-off-by: Andrew Morton

    Anithra P Janakiraman
     

16 Mar, 2011

1 commit


18 Jun, 2009

1 commit


25 Mar, 2009

1 commit


29 Oct, 2008

1 commit


06 Aug, 2008

1 commit

  • This brings the watchdog drivers into line with coding style.
    This patch takes cares of the indentation as described in chapter 1.
    Main changes:
    * Re-structure the ioctl switch call for all drivers as follows:
    switch (cmd) {
    case WDIOC_GETSUPPORT:
    case WDIOC_GETSTATUS:
    case WDIOC_GETBOOTSTATUS:
    case WDIOC_GETTEMP:
    case WDIOC_SETOPTIONS:
    case WDIOC_KEEPALIVE:
    case WDIOC_SETTIMEOUT:
    case WDIOC_GETTIMEOUT:
    case WDIOC_GETTIMELEFT:
    default:
    }

    This to make the migration from the drivers to the uniform watchdog
    device driver easier in the future.

    Signed-off-by: Wim Van Sebroeck

    Wim Van Sebroeck
     

21 Jun, 2008

1 commit


18 Oct, 2007

1 commit