Watchdog does not reset system when it is in standby/suspend

If the system enters a low power state of standby or suspend, then the watchdog does not reset the system and it continues to sleep forever. For example:

echo "" > /dev/watchdog
echo mem > /sys/power/state

This is not expected behavior - a “watchdog” should not go off to sleep along with the rest of the system.

This is not expected behavior - a “watchdog” should not go off to sleep along with the rest of the system.

Says who?

Then, please explain to me how it “should” work. Who exactly is gonna service that watchdog in suspend?

Who exactly is gonna service that watchdog in suspend?

Nobody. And if the duration of the suspend is longer than the watchdog timeout then the watchdog should reset the system. Because the whole point of a watchdog is to rescue the system out of a state in which it is stuck.

Hi @vcds

Please refer to the below links for watchdog-linux article
link1,watchdog-linux

@marcel.tx @ashok.tx

According to the i.MX6ULL Reference Manual (pages 4093-4094), the default operation of the watchdog is to continue the timer during low-power modes. The default value of the WDZST bit of the watchdog control register WDOG_WCR is 0: Continue timer operation.

I looked at the source of the watchdog driver [imx2_wdt.c « watchdog « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules] and as far as I can tell, the WDZST bit is not explicitly set in the imx2_wdt_setup function.

So, the watchdog should really be working during system suspend.

Linux source code is open and you are free to modify WD behavior if a current one does not satisfy your needs.

@alex.tx

The Toradex website has a woefully obsolete version of the driver which misled me [imx2_wdt.c « watchdog « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules].

A patch was committed for the imx2 driver in 2014 that explicitly set the WDZST bit [watchdog: imx2_wdt: disable watchdog timer during low power mode · torvalds/linux@1a9c5ef · GitHub], and this behavior has apparently remained so since then.

Unfortunately link to Toradex git you provided is broken, but looks like you selected a wrong branch. List of currently used branches can be found here.

Patch you mentioned is included in our tree. You can check it here.