Skip to contentSkip to conversation

Default behavior of watchdog drivers

DISCUSSION Jean Delvare 3 participants 3 messages Sep 27, 2018 – Oct 1, 2018 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

Hello,

It seems that various watchdog drivers behave differently if the watchdog timer is already enabled when the driver is loaded:

* iTCO_wdt will disable the timer. I think this is what most drivers do, but not all.
* w83627hf_wdt will let the timer run, unless option early_disable=1 is passed.

These are the 2 which bother me the most because they are among the most popular watchdog drivers on x86 systems. Having a different behavior depending on which driver is used is quite confusing.

Can we please settle on a default behavior (either all drivers reset the timer a load time, or none do it) and have all watchdog drivers stick to that?

If an option to get the opposite behavior is deemed useful, can we settle on a standard name for it? Or even implement it at the watchdog_core level, so that each driver doesn't need to implement it separately?

While looking into this, I found a few other strange module parameters:

* f71808e_wdt has "start_withtimeout", which starts the timer even if nobody opens the watchdog device node. Giel, do we really need this?
* octeon-wdt has "disable", which completely disables the watchdog function. This "feature" was sneaked in via commit 381cec022e46 ("watchdog: octeon-wdt: File cleaning.") which was supposed to be a cleanup-only patch, without any explanation nor even mention. I can't see how such an option can be useful. If you don't need the driver, just don't load it. Steven, can you explain?

Thanks,

Signature · 2 lines
Jean Delvare
SUSE L3 Support
maintainer
#1 lore raw

Hi Jean,

Quoted 10 lines · Jean Delvare

Hello,

It seems that various watchdog drivers behave differently if the watchdog timer is already enabled when the driver is loaded:

* iTCO_wdt will disable the timer. I think this is what most drivers do, but not all.
* w83627hf_wdt will let the timer run, unless option early_disable=1 is passed.

Quoted 8 lines

These are the 2 which bother me the most because they are among the most popular watchdog drivers on x86 systems. Having a different behavior depending on which driver is used is quite confusing.

Can we please settle on a default behavior (either all drivers reset the timer a load time, or none do it) and have all watchdog drivers stick to that?

Since

ee142889e32f watchdog: Introduce WDOG_HW_RUNNING flag 664a39236e71 watchdog: Introduce hardware maximum heartbeat in watchdog core

the default behavior _should_ be that the timer is kept running but the core is informed that it is running. Of course, that doesn't mean that (legacy) drivers actually do that.

Please note that some watchdog drivers can not be stopped, so a common mechanism to stop watchdogs during probe is technically impossible.

Quoted 9 lines

If an option to get the opposite behavior is deemed useful, can we settle on a standard name for it? Or even implement it at the watchdog_core level, so that each driver doesn't need to implement it separately?

While looking into this, I found a few other strange module parameters:

* f71808e_wdt has "start_withtimeout", which starts the timer even if nobody opens the watchdog device node. Giel, do we really need this?

We had requests for a common mechanism to do that, ie some kind of boot timeout. Idea would be to reboot the system if the watchdog device has not been opened after a set period of time. Maybe that is the idea here.

Guenter

Quoted 9 lines

* octeon-wdt has "disable", which completely disables the watchdog function. This "feature" was sneaked in via commit 381cec022e46 ("watchdog: octeon-wdt: File cleaning.") which was supposed to be a cleanup-only patch, without any explanation nor even mention. I can't see how such an option can be useful. If you don't need the driver, just don't load it. Steven, can you explain?

Thanks,

#2 lore raw

Hi Jean, Guenter,

Quoted 20 lines · Guenter Roeck

Hi Jean,

Quoted 9 lines · Jean Delvare

It seems that various watchdog drivers behave differently if the watchdog timer is already enabled when the driver is loaded:

... snip ...

Can we please settle on a default behavior (either all drivers reset the timer a load time, or none do it) and have all watchdog drivers stick to that?

... snip ...

Quoted 5 lines

If an option to get the opposite behavior is deemed useful, can we settle on a standard name for it? Or even implement it at the watchdog_core level, so that each driver doesn't need to implement it separately?

Quoted 8 lines
Quoted 4 lines

While looking into this, I found a few other strange module parameters:

* f71808e_wdt has "start_withtimeout", which starts the timer even if nobody opens the watchdog device node. Giel, do we really need this?

We had requests for a common mechanism to do that, ie some kind of boot timeout. Idea would be to reboot the system if the watchdog device has not been opened after a set period of time. Maybe that is the idea here.

The purpose of this parameter is to reduce the time window that we need to trust software to behave correctly. Withthis parameter we don't need to trust user land at all in order to still be protected by the watchdog.

I'm not sure currently because I no longer work for the company that relied on this. But, from memory, the init system that was being used at the time was, occassionaly, prone to hang due to some services hanging at startup, preventing watchdog startup. These were systems deployed at distant locations
in the field with, unreliable, GPRS connections for remote maintenance. This watchdog parameter completely eliminated the need for field trips for anything
less than hardware failure in the time that I was there (about a year).

Signature · 3 lines
Met vriendelijke groet,
With kind regards,
Giel van Schijndel