watchdog: honour hw_margin_ms DT property
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 13 Mar 2020 16:04:58 +0000 (17:04 +0100)
committerStefan Roese <sr@denx.de>
Wed, 15 Apr 2020 06:54:00 +0000 (08:54 +0200)
commit40d7f3c8d111d4e4b6c1df105d5a4cedf5b7d6c1
tree21f161d23e0a1179b26d5f80354e06eeae906861
parentb4d9452c442769e6dc25649ac02db2d5ed5ea0c8
watchdog: honour hw_margin_ms DT property

Some watchdog devices, e.g. external gpio-triggered ones, must be
reset more often than once per second, which means that the current
rate-limiting logic in watchdog_reset() fails to keep the board alive.

gpio-wdt.txt in the linux source tree defines a "hw_margin_ms"
property used to specifiy the maximum time allowed between resetting
the device. Allow any watchdog device to specify such a property, and
then use a reset period of one quarter of that. We keep the current
default of resetting once every 1000ms.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/watchdog/wdt-uclass.c