15 Oct, 2016

1 commit

  • …/kernel/git/shuah/linux-kselftest

    Pull kselftest updates from Shuah Khan:
    "This update consists of:

    - Fixes and improvements to existing tests

    - Moving code from Documentation to selftests, samples, and tools:

    * Moves dnotify_test, prctl, ptp, vDSO, ia64, watchdog, and
    networking tests from Documentation to selftests.

    * Moves mic/mpssd, misc-devices/mei, timers, watchdog, auxdisplay,
    and blackfin examples from Documentation to samples.

    * Moves accounting, laptops/dslm, and pcmcia/crc32hash tools from
    Documentation to tools.

    * Deletes BUILD_DOCSRC and its dependencies"

    * tag 'linux-kselftest-4.9-rc1-update' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (21 commits)
    selftests/futex: Check ANSI terminal color support
    Doc: update 00-INDEX files to reflect the runnable code move
    samples: move blackfin gptimers-example from Documentation
    tools: move pcmcia crc32hash tool from Documentation
    tools: move laptops dslm tool from Documentation
    tools: move accounting tool from Documentation
    samples: move auxdisplay example code from Documentation
    samples: move watchdog example code from Documentation
    samples: move timers example code from Documentation
    samples: move misc-devices/mei example code from Documentation
    samples: move mic/mpssd example code from Documentation
    selftests: Move networking/timestamping from Documentation
    selftests: move watchdog tests from Documentation/watchdog
    selftests: move ia64 tests from Documentation/ia64
    selftests: move vDSO tests from Documentation/vDSO
    selftests: move ptp tests from Documentation/ptp
    selftests: move prctl tests from Documentation/prctl
    selftests: move dnotify_test from Documentation/filesystems
    selftests/timers: Add missing error code assignment before test
    selftests/zram: replace ZRAM_LZ4_COMPRESS
    ...

    Linus Torvalds
     

08 Oct, 2016

1 commit

  • The change adds a simple watchdog pretimeout framework infrastructure,
    its purpose is to allow users to select a desired handling of watchdog
    pretimeout events, which may be generated by some watchdog devices.

    A user selects a default watchdog pretimeout governor during
    compilation stage.

    Watchdogs with WDIOF_PRETIMEOUT capability now have one more device
    attribute in sysfs, pretimeout_governor attribute is intended to display
    the selected watchdog pretimeout governor.

    The framework has no impact at runtime on watchdog devices with no
    WDIOF_PRETIMEOUT capability set.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Guenter Roeck
    Reviewed-by: Wolfram Sang
    Tested-by: Wolfram Sang
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Vladimir Zapolskiy
     

24 Sep, 2016

2 commits

  • Since the watchdog framework centrializes the IOCTL interfaces of device
    drivers now, SETPRETIMEOUT and GETPRETIMEOUT need to be added in the
    common code.

    Signed-off-by: Robin Gong
    Signed-off-by: Wolfram Sang
    [vzapolskiy: added conditional pretimeout sysfs attribute visibility]
    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     
  • Move watchdog examples to samples and remove it from Documentation
    Makefile. Create a new Makefile to build watchdog. It can be built
    from top level directory or from watchdog directory:

    Run make -C samples/watchdog or cd samples/watchdog; make

    Acked-by: Jonathan Corbet
    Signed-off-by: Shuah Khan

    Shuah Khan
     

20 Sep, 2016

1 commit


25 Jul, 2016

1 commit

  • A recent commit added a write to the watchdog test code for doing the "magic
    close", but that caused a compile-time warning:

    Documentation/watchdog/src/watchdog-test.c: In function ‘main’:
    Documentation/watchdog/src/watchdog-test.c:94:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

    This changes the code to print a runtime warning if the write fails.

    Fixes: 5a2d3de19602 ("Documentation/watchdog: add support for magic close to watchdog-test")
    Signed-off-by: Arnd Bergmann
    Acked-by: Timur Tabi
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Arnd Bergmann
     

19 Jul, 2016

1 commit

  • Up to now, the watchdog status function called a driver function,
    which was supposed to return the watchdog status. All but one
    driver using the watchdog core did not implement this function,
    and the driver implementing it did not implement it correctly
    (the function is supposed to return WDIOF_ flags). At the same time,
    at least some of the status information can be provided by the watchdog
    core.

    Provide the available status bits directly from the watchdog driver core.
    Call the driver status function if it exists to get the boot status, but
    always provide WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING internally.
    This patch makes the 'status' sysfs attribute always available.
    This attribute is now displayed as hex number with 0x prepended to be
    easier to decode.

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

    Guenter Roeck
     

18 Jul, 2016

4 commits


15 May, 2016

1 commit


14 May, 2016

1 commit


20 Mar, 2016

1 commit

  • Pull watchdog updates from Wim Van Sebroeck:

    - new drivers for: NI 903x/913x watchdog driver, WinSystems EBC-C384
    watchdog timer and ARM SBSA watchdog driver

    - Support for NCT6102D devices

    - Improvements of the generic watchdog framework (improve restart
    handler, make set_timeout optional, introduce infrastructure
    triggered keepalives, ...

    - improvements on the pnx4008 watchdog driver

    - several smaller fixes and improvements

    * git://www.linux-watchdog.org/linux-watchdog: (28 commits)
    watchdog: Ensure that wdd is not dereferenced if NULL
    watchdog: imx2: Convert to use infrastructure triggered keepalives
    watchdog: dw_wdt: Convert to use watchdog infrastructure
    watchdog: Add support for minimum time between heartbeats
    watchdog: Make stop function optional
    watchdog: Introduce WDOG_HW_RUNNING flag
    watchdog: Introduce hardware maximum heartbeat in watchdog core
    watchdog: Make set_timeout function optional
    arm: lpc32xx: remove restart handler
    arm: lpc32xx: phy3250 remove restart hook
    watchdog: pnx4008: restart: support "cmd" from userspace
    watchdog: pnx4008: add support for soft reset
    watchdog: pnx4008: add restart handler
    watchdog: pnx4008: update logging during power-on
    watchdog: tangox_wdt: test clock rate to avoid division by 0
    watchdog: atlas7_wdt: test clock rate to avoid division by 0
    watchdog: s3c2410_wdt: Add max and min timeout values
    Watchdog: introduce ARM SBSA watchdog driver
    Documentation: add sbsa-gwdt driver documentation
    watchdog: Add watchdog timer support for the WinSystems EBC-C384
    ...

    Linus Torvalds
     

17 Mar, 2016

5 commits

  • Some watchdogs require a minimum time between heartbeats.
    Examples are the watchdogs in DA9062 and AT91SAM9x.

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

    Guenter Roeck
     
  • Not all hardware watchdogs can be stopped. The driver for
    such watchdogs would typically only set the WATCHDOG_HW_RUNNING
    flag in its stop function. Make the stop function optional and set
    WATCHDOG_HW_RUNNING in the watchdog core if it is not provided.

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

    Guenter Roeck
     
  • The WDOG_HW_RUNNING flag is expected to be set by watchdog drivers if
    the hardware watchdog is running. If the flag is set, the watchdog
    subsystem will ping the watchdog even if the watchdog device is closed.

    The watchdog driver stop function is now optional and may be omitted
    if the watchdog can not be stopped. If stopping the watchdog is not
    possible but the driver implements a stop function, it is responsible
    to set the WDOG_HW_RUNNING flag in its stop function.

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

    Guenter Roeck
     
  • Introduce an optional hardware maximum heartbeat in the watchdog core.
    The hardware maximum heartbeat can be lower than the maximum timeout.

    Drivers can set the maximum hardware heartbeat value in the watchdog data
    structure. If the configured timeout exceeds the maximum hardware heartbeat,
    the watchdog core enables a timer function to assist sending keepalive
    requests to the watchdog driver.

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

    Guenter Roeck
     
  • For some watchdogs, the watchdog driver handles timeout changes without
    explicitly setting any registers. In this situation, the watchdog driver
    might only set the 'timeout' variable but do nothing else.
    This can as well be handled by the infrastructure, so make the set_timeout
    callback optional. If WDIOF_SETTIMEOUT is configured but the .set_timeout
    callback is not available, update the timeout variable in the
    infrastructure code.

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

    Guenter Roeck
     

05 Mar, 2016

1 commit

  • The sbsa-gwdt.txt documentation in devicetree/bindings/watchdog is for
    introducing SBSA(Server Base System Architecture) Generic Watchdog
    device node info into FDT.

    Also add sbsa-gwdt introduction in watchdog-parameters.txt

    Acked-by: Arnd Bergmann
    Acked-by: Rob Herring
    Signed-off-by: Fu Wei
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Fu Wei
     

01 Mar, 2016

1 commit


01 Feb, 2016

1 commit

  • This driver adds sparc hypervisor watchdog support. The default
    timeout is 60 seconds and the range is between 1 and
    31536000 seconds. Both watchdog-resolution and
    watchdog-max-timeout MD properties settings are supported.

    Signed-off-by: Wim Coekaerts
    Reviewed-by: Julian Calaby
    Reviewed-by: Guenter Roeck
    Signed-off-by: David S. Miller

    wim.coekaerts@oracle.com
     

12 Jan, 2016

2 commits

  • The lifetime of the watchdog device pointer is different from the lifetime
    of its character device. Remove it entirely to avoid race conditions.

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

    Guenter Roeck
     
  • The Zodiac watchdog driver attaches additional sysfs attributes to the
    watchdog device. This has a number of problems: The watchdog device
    lifetime differs from the driver lifetime, and the device structure
    should therefore not be accessed from drivers. Also, creating sysfs
    attributes after driver registration results in a potential race condition
    if user space expects the attributes to exist but they don't exist yet.

    Add support for creating driver specific sysfs attributes to the watchdog
    core to solve the problems.

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

    Guenter Roeck
     

30 Dec, 2015

1 commit

  • All variables required by the watchdog core to manage a watchdog are
    currently stored in struct watchdog_device. The lifetime of those
    variables is determined by the watchdog driver. However, the lifetime
    of variables used by the watchdog core differs from the lifetime of
    struct watchdog_device. To remedy this situation, watchdog drivers
    can implement ref and unref callbacks, to be used by the watchdog
    core to lock struct watchdog_device in memory.

    While this solves the immediate problem, it depends on watchdog drivers
    to actually implement the ref/unref callbacks. This is error prone,
    often not implemented in the first place, or not implemented correctly.

    To solve the problem without requiring driver support, split the variables
    in struct watchdog_device into two data structures - one for variables
    associated with the watchdog driver, one for variables associated with
    the watchdog core. With this approach, the watchdog core can keep track
    of its variable lifetime and no longer depends on ref/unref callbacks
    in the driver. As a side effect, some of the variables originally in
    struct watchdog_driver are now private to the watchdog core and no longer
    visible in watchdog drivers.

    As a side effect of the changes made, an ioctl will now always fail
    with -ENODEV after a watchdog device was unregistered with the character
    device still open. Previously, it would only fail with -ENODEV in some
    situations. Also, ioctl operations are now atomic from driver perspective.
    With this change, it is now guaranteed that the driver will not unregister
    a watchdog between a timeout change and the subsequent ping.

    The 'ref' and 'unref' callbacks in struct watchdog_driver are no longer
    used and marked as deprecated.

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

    Guenter Roeck
     

13 Dec, 2015

2 commits

  • Many watchdog drivers register a reboot notifier in order to stop the
    watchdog on system reboot. Thus we can factorize this code in the
    watchdog core.

    For that purpose, a new notifier block is added in watchdog_device for
    internal use only, as well as a new watchdog_stop_on_reboot helper
    function.

    If this helper is called, watchdog core registers the related notifier
    block and will stop the watchdog when SYS_HALT or SYS_DOWN is received.

    Since this operation can be critical on some platforms, abort the device
    registration if the reboot notifier registration fails.

    Suggested-by: Vivien Didelot
    Signed-off-by: Damien Riegel
    Reviewed-by: Vivien Didelot
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Damien Riegel
     
  • Many watchdog drivers implement the same code to register a restart
    handler. This patch provides a generic way to set such a function.

    The patch adds a new restart watchdog operation. If a restart priority
    greater than 0 is needed, the driver can call
    watchdog_set_restart_priority to set it.

    Suggested-by: Vivien Didelot
    Signed-off-by: Damien Riegel
    Reviewed-by: Guenter Roeck
    Reviewed-by: Vivien Didelot
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Damien Riegel
     

10 Sep, 2015

1 commit


01 Jul, 2015

1 commit

  • Add a early_enable module parameter to the omap_wdt that starts the
    watchdog on module insertion. The default value is 0 which does not
    start the watchdog - which also does not change the behavior if the
    parameter is not given.

    Signed-off-by: Lars Poeschel
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Lars Poeschel
     

29 Jun, 2015

1 commit


22 Jun, 2015

1 commit


26 Sep, 2014

1 commit


06 Aug, 2014

1 commit


31 Mar, 2014

2 commits

  • On some hardware platforms, the it87_wdt watchdog resets the machine
    despite the watchdog daemon running and writing to /dev/watchdog.

    This is due to Consumer IR buffer underrun interrupts being used as
    triggers to reset the timer. On some buggy hardware implementations
    such as the iEi AFL-12A-N270 single-board computer, this method does
    not work.

    However, resetting the timer by writing its original timeout value in
    its configuration register over and over again suppresses the unwanted
    reboots.

    Add a module option (nocir), 0 by default in order not to break existing
    setups. Setting it to 1 enables the workaround.

    Fixes bug #42801 .
    Tested primarily on Linux 3.5.7, applies cleanly on Linux 3.13.5.

    Signed-off-by: Marc van der Wal
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Marc van der Wal
     
  • Add a driver for the hardware watchdogs in NVIDIA Tegra SoCs (Tegra30 and
    later). This driver will configure one watchdog timer that will reset the
    system in the case of a watchdog timeout.

    This driver binds to the nvidia,tegra30-timer device node and gets its
    register base from there.

    Signed-off-by: Andrew Chew
    Reviewed-by: Guenter Roeck
    Tested-by: Stephen Warren
    Reviewed-by: Stephen Warren
    Signed-off-by: Wim Van Sebroeck

    Andrew Chew
     

12 Jul, 2013

1 commit

  • Interrupt request doesn't use the right API: The TWD watchdog uses a per-cpu
    interrupt (usually interrupt #30), and the GIC configuration should flag it as
    such. With this setup, request_irq() should fail, and the right API is
    request_percpu_irq(), together with enable_percpu_irq()/disable_percpu_irq().

    Nothing ensures the userspace ioctl() will end-up kicking the watchdog on the
    right CPU.

    There are no users of this driver since a long time and it makes more sense to
    get rid of it as nobody is looking to fix it.

    In case somebody wakes up after this has been removed and needs it, please
    revert this driver and pick these updates (These were never pushed to mainline):

    http://comments.gmane.org/gmane.linux.ports.arm.kernel/245998

    Signed-off-by: Viresh Kumar
    Acked-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Viresh Kumar
     

01 Mar, 2013

1 commit

  • Add support for watchdog drivers to initialize/set the timeout field
    of the watchdog_device structure. The timeout field is initialised
    either with the module timeout parameter value (if valid) or with the
    timeout-sec dt property (if valid). If both are invalid the initial
    value is unchanged.

    Signed-off-by: Fabio Porcedda
    Acked-by: Nicolas Ferre
    Signed-off-by: Wim Van Sebroeck

    Fabio Porcedda
     

29 Aug, 2012

1 commit


30 May, 2012

2 commits

  • This driver adds support for the watchdog functionality provided by
    the Dialog Semiconductor DA9052 PMIC chip.

    Tested on samsung smdkv6410 and i.mx53 QS boards.

    Signed-off-by: Anthony Olech
    Signed-off-by: Ashish Jangam
    Signed-off-by: Wim Van Sebroeck

    Ashish Jangam
     
  • If a driver's watchdog_device struct is part of a dynamically allocated
    struct (which it often will be), merely locking the module is not enough,
    even with a drivers module locked, the driver can be unbound from the device,
    examples:
    1) The root user can unbind it through sysfd
    2) The i2c bus master driver being unloaded for an i2c watchdog

    I will gladly admit that these are corner cases, but we still need to handle
    them correctly.

    The fix for this consists of 2 parts:
    1) Add ref / unref operations, so that the driver can refcount the struct
    holding the watchdog_device struct and delay freeing it until any
    open filehandles referring to it are closed
    2) Most driver operations will do IO on the device and the driver should not
    do any IO on the device after it has been unbound. Rather then letting each
    driver deal with this internally, it is better to ensure at the watchdog
    core level that no operations (other then unref) will get called after
    the driver has called watchdog_unregister_device(). This actually is the
    bulk of this patch.

    Signed-off-by: Hans de Goede
    Signed-off-by: Wim Van Sebroeck

    Hans de Goede