]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
watchdog: core: Clear WDOG_HW_RUNNING before calling the stop function
authorGuenter Roeck <linux@roeck-us.net>
Thu, 21 Jul 2016 21:21:56 +0000 (14:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:21:24 +0000 (15:21 +0200)
commitb7d9885f97676b5b0c5162bd4720c1f956306813
treef1841e33f7bcf5742696deb7b87f6c742a2b31f8
parent0c8716b6e61f139f22ddd2d9a9366b696830e73f
watchdog: core: Clear WDOG_HW_RUNNING before calling the stop function

commit 3c10bbde10fe4dca52726e246cefa6b0a1dfbd3e upstream.

WDOG_HW_RUNNING indicates that the hardware watchdog is running while the
watchdog device is closed. The flag may be set by the driver when it is
instantiated to indicate that the watchdog is running, and that the
watchdog core needs to send heartbeat requests to the driver until the
watchdog device is opened.

When the watchdog device is closed, the flag can be used by the driver's
stop function to indicate to the watchdog core that it was unable to stop
the watchdog, and that the watchdog core needs to send heartbeat requests.
This only works if the flag is actually cleared when the watchdog is
stopped. To avoid having to clear the flag in each driver's stop function,
clear it in the watchdog core before calling the stop function.

Reported-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Fixes: ee142889e32f ("watchdog: Introduce WDOG_HW_RUNNING flag")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/watchdog/watchdog_dev.c