]> git.baikalelectronics.ru Git - kernel.git/commit
watchdog: rti_wdt: Fix calculation and evaluation of preset heartbeat
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 21 Feb 2022 16:22:38 +0000 (17:22 +0100)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sat, 21 May 2022 08:07:32 +0000 (10:07 +0200)
commitf506ec2501823a6cb71f5826ddd24fac1233debf
tree0a5768e5705437fe88aed5555c1b3731178ca7fb
parent513c316bf3693da0ccad8e3a05cef8dd7b1a9dcf
watchdog: rti_wdt: Fix calculation and evaluation of preset heartbeat

This ensures that the same value is read back as was eventually
programmed when using seconds as accuracy. Even then, comparing the more
precise heartbeat_ms against heartbeat in seconds will almost never
provide a match and will needlessly raise a warning. Fix by comparing
apples to apples.

Tested in combination with U-Boot as watchdog starter.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/6a4b54ac-9588-e172-c4c7-b91d524a851e@siemens.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/rti_wdt.c