Skip to contentSkip to conversation

watchdog: dw_wdt: Fix default timeout

PATCH In review Sebastian Reichel 2 participants 2 messages Jul 17, 2025 – Jul 18, 2025 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: dw_wdt: Fix default timeout

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.

---
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(+)
drivers/watchdog/dw_wdt.c +2 -0
index 26efca9ae0e7d2fea1b2eaf68085a70829b62b3a..c3fbb6068c520133c8a4ca97313706e877857a7f 100644
@@ -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,

Signature · 1 line
Sebastian Reichel <[email protected]>
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · 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.

Quoted 26 lines

---
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(+)
drivers/watchdog/dw_wdt.c +2 -1
index 26efca9ae0e7d2fea1b2eaf68085a70829b62b3a..c3fbb6068c520133c8a4ca97313706e877857a7f 100644
@@ -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,