Hi Juuso,
On 2026-07-10T04:51:17, Juuso Rinta <[email protected]> wrote:
> watchdog: sandbox_wdt: add get_timeout operation
>
> Implement the get_timeout operation for the sandbox watchdog driver.
>
> Signed-off-by: Juuso Rinta <[email protected]>
>
> drivers/watchdog/sandbox_wdt.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
> diff --git a/drivers/watchdog/sandbox_wdt.c b/drivers/watchdog/sandbox_wdt.c
> @@ -43,11 +43,20 @@ static int sandbox_wdt_expire_now(struct udevice *dev,
> ulong flags)
> +static int sandbox_wdt_get_timeout(struct udevice *dev, u64 *timeout)
> +{
> + struct sandbox_state *state = state_get_current();
> +
> + *timeout = state->wdt.counter;
> + return 0;
> +}
Since sandbox_wdt_start() stores the requested timeout unchanged in
'counter', the effective value always equals the requested one, so the
clamped-timeout case and the new 'requested' print in wdt_start() have
no test coverage in patch 6. Please can you make sandbox_wdt_start()
clamp the timeout to a maximum defined in asm/state.h, so the mismatch
path can be tested, including the console output via
ut_assert_nextline() ?
Also, please rename the parameter to 'timeout_ms' to match the ops
declaration in wdt.h and the other drivers, and add a blank line
before the return to match the rest of this file.
Regards,
Simon