25 Jul, 2016

5 commits

  • In case of error, the function devm_ioremap() returns NULL pointer
    not ERR_PTR(). The IS_ERR() test in the return value check should
    be replaced with NULL test.

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     
  • Remove .owner field if calls are used which set it automatically.

    Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     
  • Remove .owner field if calls are used which set it automatically.

    Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     
  • Document support for the Watchdog Timer (WDT) Controller in the Renesas
    R-Car M3-W (r8a7796) SoC.

    No driver update is needed.

    Signed-off-by: Geert Uytterhoeven
    Acked-by: Wolfram Sang
    Acked-by: Rob Herring
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Geert Uytterhoeven
     
  • 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

2 commits

  • The watchdog status function is supposed to return WDIOF_ flags,
    not internal status flags. The available WDIOF_ flags are now
    returned by the watchdog core, so the status function in this driver
    is unnecessary.

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

    Guenter Roeck
     
  • 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

33 commits

  • Setting max_hw_heartbeat_ms lets the watchdog core provide a virtual
    timeout if the timeout requested by user space is larger than the maximum
    hardware timeout. Also, it helps the watchdog core to provide heartbeats
    if the hardware watchdog is running while closed.

    Fixes: a3e376d26ace ("watchdog: tangox: Mark running watchdog correctly")
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • If the driver indicates that the watchdog is running, the framework
    should feed it until userspace opens the device, regardless of whether
    the driver has set max_hw_heartbeat_ms.

    This patch only affects the case where wdd->max_hw_heartbeat_ms is
    zero, wdd->timeout is non-zero, the watchdog is not active and the
    hardware device is running (*):

    - If wdd->timeout is zero, watchdog_need_worker() returns false both
    before and after this patch, and watchdog_next_keepalive() is not
    called.

    - If watchdog_active(wdd), the return value from watchdog_need_worker
    is also the same as before (namely, hm && t > hm). Hence in that case,
    watchdog_next_keepalive() is only called if hm == max_hw_heartbeat_ms
    is non-zero, so the change to min_not_zero there is a no-op.

    - If the watchdog is not active and the device is not running, we
    return false from watchdog_need_worker just as before.

    That leaves the watchdog_hw_running(wdd) && !watchdog_active(wdd) &&
    wdd->timeout case. Again, it's easy to see that if
    wdd->max_hw_heartbeat_ms is non-zero, we return true from
    watchdog_need_worker with and without this patch, and the logic in
    watchdog_next_keepalive is unchanged. Finally, if
    wdd->max_hw_heartbeat_ms is 0, we used to end up in the
    cancel_delayed_work branch, whereas with this patch we end up
    scheduling a ping timeout_ms/2 from now.

    (*) This should imply that no current kernel drivers are affected,
    since the only drivers which explicitly set WDOG_HW_RUNNING are
    imx2_wdt.c and dw_wdt.c, both of which also provide a non-zero value
    for max_hw_heartbeat_ms. The watchdog core also sets WDOG_HW_RUNNING,
    but only when the driver doesn't provide ->stop, in which case it
    must, according to Documentation/watchdog/watchdog-kernel-api.txt, set
    max_hw_heartbeat_ms.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Rasmus Villemoes
     
  • Add support for MCP78S chipset in nv_tco watchdog driver

    Signed-off-by: Aleksey Kunitskiy
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Alexey Kunitskiy
     
  • bcm2835_wdt_set_timeout does exactly what the watchdog framework does
    in the absence of a ->set_timeout callback (see watchdog_set_timeout
    in watchdog_dev.c), so remove it.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Guenter Roeck
    Acked-by: Eric Anholt
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Rasmus Villemoes
     
  • These are never modified, so might as well be const.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Guenter Roeck
    Acked-by: Eric Anholt
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Rasmus Villemoes
     
  • Acked-by: Rob Herring
    Signed-off-by: Neil Armstrong
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Neil Armstrong
     
  • Add watchdog specific driver for Amlogic Meson GXBB SoC.

    Signed-off-by: Neil Armstrong
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Neil Armstrong
     
  • For certain parts and some versions of TZ, TZ will reset the chip
    when a BARK is triggered even though it was not configured here. So
    by default let's configure this BARK time as well.

    Signed-off-by: Matthew McClintock
    Reviewed-by: Guenter Roeck
    Signed-off-by: Thomas Pedersen
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Matthew McClintock
     
  • Commit 0dfd582e026a ("watchdog: qcom: use timer devicetree
    binding") moved to use the watchdog as a subset timer
    register block. Some devices have the watchdog completely
    standalone with slightly different register offsets as
    well so let's account for the differences here.

    The existing "kpss-standalone" compatible string doesn't
    make it entirely clear exactly what the device is so
    rename to "kpss-wdt" to reflect watchdog timer
    functionality. Also update ipq4019 DTS with an SoC
    specific compatible.

    Signed-off-by: Matthew McClintock
    Signed-off-by: Thomas Pedersen
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Matthew McClintock
     
  • Update the compatible string to align with driver and also
    add SoC specific string to DTS.

    CC: linux-watchdog@vger.kernel.org
    Signed-off-by: Matthew McClintock
    Signed-off-by: Thomas Pedersen
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Matthew McClintock
     
  • Triggering the watchdog faster than T_WDMIN=256ms leads to resets of the
    DA9063 chip. The datasheet says that the watchdog must only be triggered
    in the timeframe T_WDMIN to T_WDMAX. The T_WDMAX is configured in the
    driver.

    Signed-off-by: Stefan Christ
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Stefan Christ
     
  • Some drivers have the WDIOF_MAGICCLOSE set, which means that applications
    need to write 'V' to the watchdog device before closing, otherwise the
    driver won't stop the watchdog timer.

    Signed-off-by: Timur Tabi
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Timur Tabi
     
  • The watchdog-test utility outputs all messages to stderr, even those
    that are not error messages. Output to stdout instead.

    Instead of flushing the output after every write, just disabled
    the output buffer.

    Also display a dot for every ping of the watchdog, so that the user
    knows that it's working.

    Signed-off-by: Timur Tabi
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Timur Tabi
     
  • The TCO I/O base is 40h rather than the usual 30h, and the re_reboot
    bit is at ACPIBASE+8.

    Signed-off-by: Yong, Jonathan
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Yong, Jonathan
     
  • The Apollo Lake Watchdog has the no_reboot flag in the 4th bit.

    Signed-off-by: Yong, Jonathan
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Yong, Jonathan
     
  • In case of error, the function devm_kzalloc() returns NULL pointer
    not ERR_PTR(). The IS_ERR() test in the return value check should
    be replaced with NULL test.

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     
  • In case of error, the function devm_kzalloc() returns NULL pointer
    not ERR_PTR(). The IS_ERR() test in the return value check should
    be replaced with NULL test.

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     
  • The I2C core removes the manufacturer prefix from the compatible field
    so it reports to user-space the uevent i2c:rave-wdt, but this doesn't
    match with the i2c_device_id (i2c:ziirave-wdt) array so the module is not
    autoloaded. Correct the I2C device id to match with the reported uevent
    and fix the module autoloading functionality.

    Signed-off-by: Enric Balletbo i Serra
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Enric Balletbo i Serra
     
  • The option 'default n' and its absence are equal for kbuild,
    which makes explicit 'default n' redundant.

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

    Vladimir Zapolskiy
     
  • Maxim PMIC MAX77620 is Power management IC which have multiple
    sub blocks like regulators (DCDC/LDOs), GPIO, RTC, Clock, Watchdog
    timer etc.

    Add the driver for watchdog timer under watchdog framework.
    The driver implements the watchdog callbacks to start, stop,
    ping and set timeout for watchodg framework.

    Signed-off-by: Laxman Dewangan
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Laxman Dewangan
     
  • Adds watchdog enable support for Fintek F81866 Super-IO chip to
    Fintek wdt driver (f71808e_wdt)

    Tested and verified on iBASE MI802 Industrial PC

    Datasheet references:
    http://www.alldatasheet.com/datasheet-pdf/pdf/459085/FINTEK/F81866AD-I.html

    Suggested-by: Guenter Roeck
    Signed-off-by: Ji-Ze Hong (Peter Hong)
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Ji-Ze Hong (Peter Hong)
     
  • Fix the following warnings from sparse due to casting to/from an __iomem
    annotated variable:

    drivers/watchdog/sirfsoc_wdt.c:48:18: warning: incorrect type in assignment (different address spaces)
    drivers/watchdog/sirfsoc_wdt.c:48:18: expected void [noderef] *wdt_base
    drivers/watchdog/sirfsoc_wdt.c:48:18: got void *
    drivers/watchdog/sirfsoc_wdt.c:64:18: warning: incorrect type in assignment (different address spaces)
    drivers/watchdog/sirfsoc_wdt.c:64:18: expected void [noderef] *wdt_base
    drivers/watchdog/sirfsoc_wdt.c:64:18: got void *
    drivers/watchdog/sirfsoc_wdt.c:82:54: warning: incorrect type in initializer (different address spaces)
    drivers/watchdog/sirfsoc_wdt.c:82:54: expected void [noderef] *wdt_base
    drivers/watchdog/sirfsoc_wdt.c:82:54: got void *
    drivers/watchdog/sirfsoc_wdt.c:99:54: warning: incorrect type in initializer (different address spaces)
    drivers/watchdog/sirfsoc_wdt.c:99:54: expected void [noderef] *wdt_base
    drivers/watchdog/sirfsoc_wdt.c:99:54: got void *
    drivers/watchdog/sirfsoc_wdt.c:153:44: warning: incorrect type in argument 2 (different address spaces)
    drivers/watchdog/sirfsoc_wdt.c:153:44: expected void *data
    drivers/watchdog/sirfsoc_wdt.c:153:44: got void [noderef] *[assigned] base

    Signed-off-by: Ben Dooks
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Ben Dooks
     
  • A running watchdog is marked with WDOG_HW_RUNNING, not with WDOG_ACTIVE.
    WDOG_ACTIVE indicates that the watchdog device has been opened from user
    space.

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

    Guenter Roeck
     
  • The description of min_hw_heartbeat_ms is misleading and needs some
    improvements.

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

    Guenter Roeck
     
  • This patch uses the new flag WDOG_HW_RUNNING in driver.
    According to the definition of this flag, it should be set,
    if watchdog is running after booting, before it's opened.

    Signed-off-by: Pratyush Anand
    Signed-off-by: Fu Wei
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Pratyush Anand
     
  • Using max_hw_heartbeat_ms instead of max_timeout gives the flexibility to
    achieve higher user "timeout". Therefore, use this new infrastructure.

    Signed-off-by: Pratyush Anand
    Signed-off-by: Fu Wei
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Pratyush Anand
     
  • When max_hw_heartbeat_ms has a none zero value, max_timeout is not used.
    So it's value can be 0. In such case if a driver uses min_timeout
    functionality, then check will always fail.

    This patch fixes above issue.

    Signed-off-by: Pratyush Anand
    Signed-off-by: Fu Wei
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Pratyush Anand
     
  • This driver does not do anything special in module init/exit. This patch
    eliminates the module init/exit boilerplate code by utilizing the
    module_isa_driver macro.

    Signed-off-by: William Breathitt Gray
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    William Breathitt Gray
     
  • Provides generic watchdog features as well as reboot support for the
    Aspeed SoCs.

    Signed-off-by: Joel Stanley
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Joel Stanley
     
  • Signed-off-by: Joel Stanley
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Joel Stanley
     
  • Signed-off-by: Wolfram Sang
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     
  • If we leave set_timeout empty, the core will do exactly what is
    implemented here anyway.

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

    Wolfram Sang
     
  • Signed-off-by: Wolfram Sang
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang