summaryrefslogtreecommitdiff
path: root/Documentation/watchdog
diff options
context:
space:
mode:
authorDamien Riegel <damien.riegel@savoirfairelinux.com>2015-11-21 00:54:51 +0300
committerWim Van Sebroeck <wim@iguana.be>2015-12-13 17:55:51 +0300
commite131319669e0ef5e6fcd75174daeffa40492135c (patch)
tree3ea2434a3d6661fd62b51efd1cfad7d0ac1c5052 /Documentation/watchdog
parent0ebad1e5e5bae3e59125675d37a70d946f283fef (diff)
downloadlinux-e131319669e0ef5e6fcd75174daeffa40492135c.tar.xz
watchdog: core: add reboot notifier support
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 <vivien.didelot@savoirfairelinux.com> Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'Documentation/watchdog')
-rw-r--r--Documentation/watchdog/watchdog-kernel-api.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt
index dbc6a65f0bd1..0a37da76acef 100644
--- a/Documentation/watchdog/watchdog-kernel-api.txt
+++ b/Documentation/watchdog/watchdog-kernel-api.txt
@@ -53,6 +53,7 @@ struct watchdog_device {
unsigned int timeout;
unsigned int min_timeout;
unsigned int max_timeout;
+ struct notifier_block reboot_nb;
struct notifier_block restart_nb;
void *driver_data;
struct mutex lock;
@@ -76,6 +77,9 @@ It contains following fields:
* timeout: the watchdog timer's timeout value (in seconds).
* min_timeout: the watchdog timer's minimum timeout value (in seconds).
* max_timeout: the watchdog timer's maximum timeout value (in seconds).
+* reboot_nb: notifier block that is registered for reboot notifications, for
+ internal use only. If the driver calls watchdog_stop_on_reboot, watchdog core
+ will stop the watchdog on such notifications.
* restart_nb: notifier block that is registered for machine restart, for
internal use only. If a watchdog is capable of restarting the machine, it
should define ops->restart. Priority can be changed through
@@ -240,6 +244,10 @@ to set the default timeout value as timeout value in the watchdog_device and
then use this function to set the user "preferred" timeout value.
This routine returns zero on success and a negative errno code for failure.
+To disable the watchdog on reboot, the user must call the following helper:
+
+static inline void watchdog_stop_on_reboot(struct watchdog_device *wdd);
+
To change the priority of the restart handler the following helper should be
used: