]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
watchdog: core: add reboot notifier support
authorDamien Riegel <damien.riegel@savoirfairelinux.com>
Fri, 20 Nov 2015 21:54:51 +0000 (16:54 -0500)
committerWim Van Sebroeck <wim@iguana.be>
Sun, 13 Dec 2015 14:55:51 +0000 (15:55 +0100)
commite131319669e0ef5e6fcd75174daeffa40492135c
tree3ea2434a3d6661fd62b51efd1cfad7d0ac1c5052
parent0ebad1e5e5bae3e59125675d37a70d946f283fef
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>
Documentation/watchdog/watchdog-kernel-api.txt
drivers/watchdog/watchdog_core.c
include/linux/watchdog.h