Re: [PATCH RESEND v2 1/5] watchdog: wdt-uclass: report effective timeout in start print

Simon Glass <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <CAFLszTiE735wxfGe=nu8rFJn1a3tYOJYa6vjOUeDazuKLCKyPA@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.