watchdog: pass USEC_INFINITY to watchdog_setup() to reuse the programmed timeout...
authorFranck Bui <fbui@suse.com>
Fri, 17 Sep 2021 08:34:35 +0000 (10:34 +0200)
committerFranck Bui <fbui@suse.com>
Wed, 13 Oct 2021 06:51:15 +0000 (08:51 +0200)
commitc1a08a76ab6761eee9d537c0e0fb6252a4961b14
tree398f27f466aeb97431b7d1a975f36985ed522c51
parentef1d5f3c5c613b9fa75d6a69bbc51a79361e28cc
watchdog: pass USEC_INFINITY to watchdog_setup() to reuse the programmed timeout value

This patch changes the meaning of USEC_INFINITY value for the watchdog
module.

Previously passing this value was a NOP. It now has a special meaning: it
requests the watchdog module to read the programmed timeout value and reuse it
for pinging the device.

This is mostly useful when the watchdog is started by the firmware and there's
no way to reconfigure the timeout with a different value
afterwards. "RuntimeWatchdogSec=infinity" in system.conf can now be used rather
than putting an arbitrary value that PID1 will fail to set (even if it still
felt back to the programmed timeout).

Please note that "infinity" is not supposed to restore the default value of the
firmware. If the value is changed after booting then "infinity" would simply
reuse the current programmed value. IOW it's a NOP unless the watchdog was
previously closed and in that case it will be reopened and the last programmed
value reused.
src/shared/watchdog.c