aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Qiang <[email protected]>2021-01-14 16:26:51 +0800
committerWim Van Sebroeck <[email protected]>2021-02-07 14:41:21 +0100
commitac288a7b1a98a11e3269573b1de05fb35b80e051 (patch)
tree3c08d8e7f5d76442bcece60c9451824959975b3d
parentfbf376056d16010dcba84aa89c2ac320b443163d (diff)
watchdog: stop wdd when watchdog hw running in reboot_notifier
In watchdog_reboot_notifier, wdd should be stopped when the device is in hw_running state Signed-off-by: Zhao Qiang <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
-rw-r--r--drivers/watchdog/watchdog_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index 0e9a99559609..5df0a22e2cb4 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -158,7 +158,7 @@ static int watchdog_reboot_notifier(struct notifier_block *nb,
wdd = container_of(nb, struct watchdog_device, reboot_nb);
if (code == SYS_DOWN || code == SYS_HALT) {
- if (watchdog_active(wdd)) {
+ if (watchdog_active(wdd) || watchdog_hw_running(wdd)) {
int ret;
ret = wdd->ops->stop(wdd);