watchdog: retry with larger timeout value if effective timeout is 0 staging/stintel/watchdog
authorJo-Philipp Wich <jo@mein.io>
Fri, 17 Jun 2022 07:47:51 +0000 (09:47 +0200)
committerStijn Tintel <stijn@linux-ipv6.be>
Thu, 23 Jun 2022 08:57:33 +0000 (11:57 +0300)
commit901afeb05ee6717e4214b1d94d184b36a13be09a
tree0c61f17a921c569dd3456e05bca2038a76e8c807
parent0ce8d7773f344016431468ea3e8cedb9d86352ff
watchdog: retry with larger timeout value if effective timeout is 0

Some watchdog drivers, such as w83793, have a very low timeout granularity
of only one minute. The procd default timeout of 30s will yield an effective
timeout of 0 with this driver, leading to an almost instant reset once
activated.

In order to gracefully deal with watchdogs having no sub-30s resolution,
check that the effectively calculated timeout returned by the ioctl() call
is zero and retry with a duplicated timeout value in this case.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
watchdog.c