watchdog: stop wdd when watchdog hw running in reboot_notifier
authorZhao Qiang <qiang.zhao@nxp.com>
Thu, 14 Jan 2021 08:26:51 +0000 (16:26 +0800)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 7 Feb 2021 13:41:21 +0000 (14:41 +0100)
In watchdog_reboot_notifier, wdd should be stopped when the device
is in hw_running state

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210114082651.17162-1-qiang.zhao@nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/watchdog_core.c

index 0e9a995..5df0a22 100644 (file)
@@ -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);