watchdog: arm_smc_wdt: get wdt status through SMCWD_GET_TIMELEFT
authorAntonio Borneo <antonio.borneo@foss.st.com>
Tue, 20 May 2025 08:59:52 +0000 (10:59 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 1 Jun 2025 11:16:29 +0000 (13:16 +0200)
commitcc0df5eba1b3a0eb54003d977a062ed39db09b0d
treee06cc8a719ecd87b97fe2fa9509e454c4f1d5a5b
parent27a46a0f088692bca08165e320e0293fd02638e2
watchdog: arm_smc_wdt: get wdt status through SMCWD_GET_TIMELEFT

The optional SMCWD_GET_TIMELEFT command can be used to detect if
the watchdog has already been started.
See the implementation in OP-TEE secure OS [1].

At probe time, check if the watchdog is already started and then
set WDOG_HW_RUNNING in the watchdog status. This will cause the
watchdog framework to ping the watchdog until a userspace watchdog
daemon takes over the control.

Link: https://github.com/OP-TEE/optee_os/commit/a7f2d4bd8632
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250520085952.210723-1-antonio.borneo@foss.st.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/arm_smc_wdt.c