Repository navigation
watchdog: read the timeout back when the driver rejects it - #55
Merged
Merged
Conversation
WDIOC_SETTIMEOUT fails with EINVAL when the driver cannot use the requested timeout, for example anything above 107 s on rt2880_wdt at 40 MHz. procd ignored the error and kept the requested value in wdt_drv_timeout, so 'ubus call system watchdog' and the "Opened watchdog with timeout" message reported a timeout that was never set, while the driver kept its previous one. Log the error and read the timeout back with WDIOC_GETTIMEOUT, as procd did before the timeout was cached. Fixes: 20192e4 ("watchdog: improve seting watchdog timeout and frequency") Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
dangowrt
force-pushed
the
watchdog-timeout-readback
branch
from
October 18, 2026 14:06
1ad618d to
fa1ebfc
Compare
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #54
If WDIOC_SETTIMEOUT fails, procd now logs it and reads the timeout back with WDIOC_GETTIMEOUT, so wdt_drv_timeout and
ubus call system watchdogmatch the driver again.I ran procd's watchdog.c in a small test program against softdog, which takes up to 65535 s. Valid timeouts behave as before. With 70000 s and 5000000 s, procd used to report the new value while softdog kept the old one; now it logs the error and reports the old one. A bad value set while the watchdog is stopped is caught the same way when it starts again.
On boards whose driver maximum is below the default 30 s, this adds an error message at boot.