* [PATCH] watchdog: dw_wdt: Fix default timeout
@ 2025-07-17 16:55 Sebastian Reichel
2025-07-18 19:45 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Reichel @ 2025-07-17 16:55 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck
Cc: linux-watchdog, linux-kernel, Sebastian Reichel
The Synopsys Watchdog driver sets the default timeout to 30 seconds,
but on some devices this is not a valid timeout. E.g. on RK3588 the
actual timeout being used is 44 seconds instead.
Once the watchdog is started the value is updated accordingly, but
it would be better to expose a sensible timeout to userspace without
the need to first start the watchdog.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
This has been found when setting up a CI pipeline, that
intentionally runs into the watchdog timeout.
---
drivers/watchdog/dw_wdt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index 26efca9ae0e7d2fea1b2eaf68085a70829b62b3a..c3fbb6068c520133c8a4ca97313706e877857a7f 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -644,6 +644,8 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
} else {
wdd->timeout = DW_WDT_DEFAULT_SECONDS;
watchdog_init_timeout(wdd, 0, dev);
+ /* Limit timeout value to hardware constraints. */
+ dw_wdt_set_timeout(wdd, wdd->timeout);
}
platform_set_drvdata(pdev, dw_wdt);
---
base-commit: e2291551827fe5d2d3758c435c191d32b6d1350e
change-id: 20250717-dw-wdt-fix-initial-timeout-d4b3a2ada6ed
Best regards,
--
Sebastian Reichel <sre@kernel.org>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] watchdog: dw_wdt: Fix default timeout
2025-07-17 16:55 [PATCH] watchdog: dw_wdt: Fix default timeout Sebastian Reichel
@ 2025-07-18 19:45 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2025-07-18 19:45 UTC (permalink / raw)
To: Sebastian Reichel, Wim Van Sebroeck; +Cc: linux-watchdog, linux-kernel
On 7/17/25 09:55, Sebastian Reichel wrote:
> The Synopsys Watchdog driver sets the default timeout to 30 seconds,
> but on some devices this is not a valid timeout. E.g. on RK3588 the
> actual timeout being used is 44 seconds instead.
>
> Once the watchdog is started the value is updated accordingly, but
> it would be better to expose a sensible timeout to userspace without
> the need to first start the watchdog.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> This has been found when setting up a CI pipeline, that
> intentionally runs into the watchdog timeout.
> ---
> drivers/watchdog/dw_wdt.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index 26efca9ae0e7d2fea1b2eaf68085a70829b62b3a..c3fbb6068c520133c8a4ca97313706e877857a7f 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -644,6 +644,8 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
> } else {
> wdd->timeout = DW_WDT_DEFAULT_SECONDS;
> watchdog_init_timeout(wdd, 0, dev);
> + /* Limit timeout value to hardware constraints. */
> + dw_wdt_set_timeout(wdd, wdd->timeout);
> }
>
> platform_set_drvdata(pdev, dw_wdt);
>
> ---
> base-commit: e2291551827fe5d2d3758c435c191d32b6d1350e
> change-id: 20250717-dw-wdt-fix-initial-timeout-d4b3a2ada6ed
>
> Best regards,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-18 19:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-17 16:55 [PATCH] watchdog: dw_wdt: Fix default timeout Sebastian Reichel
2025-07-18 19:45 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).