Hi Juuso,

On 2026-08-12T09:48:39, Juuso Rinta <[email protected]> wrote:
> watchdog: wdt-uclass: report effective timeout in start print
>
> The wdt_start() function may be called with a timeout greater
> than the hardware-supported maximum. This in turn can result
> in a bogus print, for example, if the device clamps the timeout
> to 10s but wdt_start() is called with a 60s timeout:
> Started <watchdog@> with servicing every 1000ms (60s timeout)
>
> Add a max_timeout_ms field to uclass-plat data, so drivers can
> set the hardware-limited max timeout value there during probing.
> For drivers that support this feature, the startup print now
> shows both the actual and requested timeout values, e.g.
> Started <watchdog@> with servicing every 1000ms (10s timeout, requested 60s)
>
> The timeout comparison is done in whole seconds to avoid noise
> from sub-second rounding.
>
> The value defaults to 0. For drivers that do not support
> this feature, the resulting print remains the same as before.
>
> While at it, rename the string str in wdt_start() to svc_str for
> cleaner distinction from the new req_str, replace its memset with
> svc_str[0] = '\0', and use sizeof(svc_str) instead of the magic 16
> in the snprintf.

Normally a cleanup like that would be best in a separate patch, BTW.

> [...]
>
> drivers/watchdog/wdt-uclass.c | 34 +++++++++++++++++++++++++++++-----
>  include/wdt.h                 | 11 +++++++++++
>  2 files changed, 40 insertions(+), 5 deletions(-)

Reviewed-by: Simon Glass <[email protected]>

Regards,
Simon

Reply via email to