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
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
18 Jul, 2016
4 commits
-
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 -
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 -
The description of min_hw_heartbeat_ms is misleading and needs some
improvements.Signed-off-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck -
Remove Tom's email address from the documentation
Signed-off-by: Brian Boylston
Reviewed-by: Guenter Roeck
Signed-off-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck
15 May, 2016
1 commit
-
The WinSystems EBC-C384 watchdog timer driver supports two module
parameters: timeout and nowayout. These parameters should be documented
in the watchdog-parameters.txt file.Signed-off-by: William Breathitt Gray
Signed-off-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck
14 May, 2016
1 commit
-
Adjust documentation to match latest kernel module parameters.
Signed-off-by: Nigel Croxon
Signed-off-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck
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
...
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 -
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 -
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 -
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 -
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
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
01 Mar, 2016
1 commit
-
Add support for the watchdog timer on NI cRIO-903x and cDAQ-913x real-
time controllers.Signed-off-by: Jeff Westfahl
Signed-off-by: Kyle Roeschley
Signed-off-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck
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
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 -
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
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
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 -
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
10 Sep, 2015
1 commit
-
The watchdog test program is much more useful if it can configure the
timeout value and ping rate. This will allow you to test actual timeouts.Adds the -t parameter to set the timeout value (in seconds), and -p to set
the ping rate (number of seconds between pings).Signed-off-by: Timur Tabi
Reviewed-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck
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
29 Jun, 2015
1 commit
-
Currently, watchdog subsystem require the misc subsystem to
register a watchdog. This may not be the case in case of an
early registration of a watchdog, which can be required when
the watchdog cannot be disabled.This patch introduces a deferral mechanism to remove this requirement.
Signed-off-by: Jean-Baptiste Theou
Reviewed-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck
22 Jun, 2015
1 commit
-
The omap_wdt kernel driver also understands the nowayout module
parameter. This updates the watchdog-parameters.txt to reflect this fact.Signed-off-by: Lars Poeschel
Reviewed-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck
26 Sep, 2014
1 commit
-
Change the Documentation makefiles from obj-m to subdir-y
to avoid generating unnecessary built-in.o files since nothing
in Documentation/ is ever linked in to vmlinux.Signed-off-by: Peter Foley
Acked-by: Sam Ravnborg
Signed-off-by: Randy Dunlap
Signed-off-by: Jiri Kosina
06 Aug, 2014
1 commit
-
This patch changes 'go of' to 'go off' and 'pretimout' to
'pretimeout'.Signed-off-by: Sangjung Woo
Acked-by: Randy Dunlap
Reviewed-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck
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 -
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
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
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
29 Aug, 2012
1 commit
-
Fix compiler warning by making the function static:
Documentation/watchdog/src/watchdog-test.c:34:6: warning: no previous prototype for 'term'
Signed-off-by: Randy Dunlap
Signed-off-by: Wim Van Sebroeck
30 May, 2012
5 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 -
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 watchdogI 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 -
This patch fixes some potential multithreading issues, despite only
allowing one process to open the /dev/watchdog device, we can still get
called multiple times at the same time, since a program could be using thread,
or could share the fd after a fork.This causes 2 potential problems:
1) watchdog_start / open do an unlocked test_n_set / test_n_clear,
if these 2 race, the watchdog could be stopped while the active
bit indicates it is running or visa versa.2) Most watchdog_dev drivers probably assume that only one
watchdog-op will get called at a time, this is not necessary
true atm.Signed-off-by: Hans de Goede
Signed-off-by: Wim Van Sebroeck -
Create the watchdog class and it's associated devices.
Signed-off-by: Alan Cox
Signed-off-by: Hans de Goede
Signed-off-by: Wim Van Sebroeck -
We keep the old /dev/watchdog interface file for the first watchdog via
miscdev. This is basically a cut and paste of the relevant interface code
from the rtc driver layer tweaked for watchdog.Revised to fix problems noted by Hans de Goede
Signed-off-by: Alan Cox
Signed-off-by: Hans de Goede
Signed-off-by: Tomas Winkler
Signed-off-by: Wim Van Sebroeck
23 May, 2012
2 commits
-
we start a infinite loop when user gives ./watchdog-test, and when user
ctrl + c's the program, we just exit immeadiately with out closing the
filedescriptor of the watchdog device. a signal handler is used to
do the job of closing the filedescriptor and exiting the program.Signed-off-by: Devendra Naga
Signed-off-by: Wim Van Sebroeck -
in the watchdog test code, the ioctl is performed on the watchdog device
and just doing exit(0) so we leak a filedescripor.Signed-off-by: Devendra Naga
Signed-off-by: Wim Van Sebroeck