-
Notifications
You must be signed in to change notification settings - Fork 8.1k
drivers: watchdog: document and enforce semantics of WDT_DISABLE_AT_BOOT
#98148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers: watchdog: document and enforce semantics of WDT_DISABLE_AT_BOOT
#98148
Conversation
WDT_DISABLE_AT_BOOT should only be used to forcefully disable watchdog timers that are enabled by default after system reset. Update the Kconfig help text of WDT_DISABLE_AT_BOOT and its dependency HAS_WDT_DISABLE_AT_BOOT to make this clear. Signed-off-by: Mathieu Choplain <[email protected]>
|
Gentle poke at NXP folks (@decsny) because there's something that seems weird in your SoCs' zephyr/soc/nxp/kinetis/CMakeLists.txt Line 20 in 8aba2e3
zephyr/soc/nxp/mcx/mcxc/CMakeLists.txt Line 21 in 8aba2e3
I'm also wondering if Finally, this probably needs an entry in migration guide/release notes since this will most likely break people's apps (for those who were using |
|
I like the idea of revisiting this and unifying behaviour across drivers. I do see a need for having the counterpart in as well (enable watchdog at boot with a given timeout), as this is a common way of ensuring that failure to fully initialise your firmware will be caught somehow (I really prefer MCUs where the watchdog is enabled at boot by hardware for this reason). |
There are many drivers which control a disabled-by-default watchdog timer but take the liberty of selecting HAS_WDT_DISABLE_AT_BOOT and interpreting WDT_DISABLE_AT_BOOT=n as "enable the timer", which does not correspond to the semantics of this option. Update all such drivers to no longer select HAS_WDT_DISABLE_AT_BOOT and ignore the WDT_DISABLE_AT_BOOT option. Signed-off-by: Mathieu Choplain <[email protected]>
572e53e to
f2217b0
Compare
|
I did consider this (i.e., Today, everyone just sets So we'd need something else, like maybe a There is definitely a need for "set some Kconfig and get a watchdog setup during boot" - that's what |



Fixes #86223 (hopefully).
The
WDT_DISABLE_AT_BOOTKconfig option has been interpreted as "enable the WDT if disabled" by some driver implementers, even though this is at best a hack. Document its true purpose explicitly and update all drivers to follow the now-documented semantics.I took a conservative approach and only updated drivers which were explicitly playing the
if (!IS_ENABLED(WDT_DISABLE_AT_BOOT)) { enable_myself(); }game, but maybe other drivers need to be updated too.