Skip to contentSkip to conversation

watchdog: core: suppress "watchdog did not stop" message

PATCH In review Tao Ren 3 participants 5 messages Nov 15, 2018 – Nov 27, 2018 Watchdog device drivers

lore
Share & tools
lore

Tao Ren

author
#0 lore raw

PATCH 1/1 watchdog: core: suppress "watchdog did not stop" message

Currently "watchdog did not stop!" message is printed when the watchdog timer is not stopped at close. For example, people may see the message when rebooting the system, or the message will be logged to console periodically if watchdog is kicked by a scirpt which runs "echo k > /dev/watchdog" command.

Given a critical message usually indicates a serious hardware/software failure, this message could easily lead to confusion, so it's better to just delete the message.

---
 drivers/watchdog/watchdog_dev.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/watchdog_dev.c +0 -1
index f6c24b22b37c..65e9ebbd8759 100644
@@ -879,7 +879,6 @@ static int watchdog_release(struct inode *inode, struct file *file)
 
 	/* If the watchdog was not stopped, send a keepalive ping */
 	if (err < 0) {
-		pr_crit("watchdog%d: watchdog did not stop!\n", wdd->id);
 		watchdog_ping(wdd);
 	}
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 11 lines · Tao Ren

Currently "watchdog did not stop!" message is printed when the watchdog timer is not stopped at close. For example, people may see the message when rebooting the system, or the message will be logged to console periodically if watchdog is kicked by a scirpt which runs "echo k > /dev/watchdog" command.

Given a critical message usually indicates a serious hardware/software failure, this message could easily lead to confusion, so it's better to just delete the message.

NACK. This message is displayed if/when the watchdog application exits without stopping the watchdog and/or without closing properly. This _is_ critical since it will reboot the system after the next timeout period.

If userspace triggers this message on purpose (eg by the mentioned script, which does not exit properly), userspace is at fault, not the kernel.

Guenter

Quoted 19 lines
---
 drivers/watchdog/watchdog_dev.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/watchdog_dev.c +0 -1
index f6c24b22b37c..65e9ebbd8759 100644
@@ -879,7 +879,6 @@ static int watchdog_release(struct inode *inode, struct file *file)
 
 	/* If the watchdog was not stopped, send a keepalive ping */
 	if (err < 0) {
-		pr_crit("watchdog%d: watchdog did not stop!\n", wdd->id);
 		watchdog_ping(wdd);
 	}
 
Signature · 1 line
2.17.1
author
#2 lore raw
Quoted 10 lines · Guenter Roeck

NACK. This message is displayed if/when the watchdog application exits without stopping the watchdog and/or without closing properly. This _is_ critical since it will reboot the system after the next timeout period.

If userspace triggers this message on purpose (eg by the mentioned script, which does not exit properly), userspace is at fault, not the kernel.

Guenter

Thank you for the quick response, Guenter. I see the log each time when I reboot my system, and when I searched the message in google, I also found posts asking why the message is printed at reboot, and that's why I feel it's confusing.

Anyways, please ignore the patch since it's necessary.

Thanks,
Tao Ren

#3 lore raw
Quoted 10 lines · Tao Ren
Quoted 9 lines · Guenter Roeck

NACK. This message is displayed if/when the watchdog application exits without stopping the watchdog and/or without closing properly. This _is_ critical since it will reboot the system after the next timeout period.

If userspace triggers this message on purpose (eg by the mentioned script, which does not exit properly), userspace is at fault, not the kernel.

Quoted 5 lines
Quoted 1 line

Guenter

Thank you for the quick response, Guenter. I see the log each time when I reboot my system, and when I searched the message in google, I also found posts asking why the message is printed at reboot, and that's why I feel it's confusing.

Anyways, please ignore the patch since it's necessary.

Tao,

If you're on a system running systemd, the default behavior is to enable the watchdog during shutdown. This guards against shutdown hanging. So this message will be routinely printed out during orderly shutdown.

See file: /etc/systemd/system.conf
----------------------------------
...
# Entries in this file show the compile time defaults.
...

#ShutdownWatchdogSec=10min

Signature · 3 lines
-----------------------------------------------------------------------------
Jerry Hoemann                  Software Engineer   Hewlett Packard Enterprise
-----------------------------------------------------------------------------
author
#4 lore raw
Quoted 5 lines · Jerry Hoemann

Tao,

If you're on a system running systemd, the default behavior is to enable the watchdog during shutdown. This guards against shutdown hanging. So this message will be routinely printed out during orderly shutdown.

Thank you Jerry for the comments.

I actually use a separate daemon process to kick the watchdog on my BMC system. The daemon monitors temperature sensors and other system states and kicks watchdog periodically: if the daemon gets stuck or exits, then the machine needs to reboot even if kernel/systemd is fine. Perhaps I need to look for a better/official way to manage the watchdog device..

BTW, I will be travelling abroad in the new few days and may not be able to reply emails timely. Thank you again for jumping in.

Best regards,
Tao Ren