Skip to content
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

watchdog:use 'V' to stop watchdog #8033

Merged
merged 1 commit into from
Jan 6, 2023
Merged

Conversation

anjiahao1
Copy link
Contributor

@anjiahao1 anjiahao1 commented Jan 5, 2023

Summary

add a way to stop watchdog, follow Linux watchdog behavior:
https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt:
Magic Close feature:

If a driver supports "Magic Close", the driver will not disable the
watchdog unless a specific magic character 'V' has been sent to
/dev/watchdog just before closing the file. If the userspace daemon
closes the file without sending this special character, the driver
will assume that the daemon (and userspace in general) died, and will
stop pinging the watchdog without disabling it first. This will then
cause a reboot if the watchdog is not re-opened in sufficient time.

Impact

watchdog driver

Testing

vela

Copy link
Contributor

@hartmannathan hartmannathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this shouldn't be an optional feature (with Kconfig). Rationale: Perhaps the application developer wants to ensure that a watchdog will not be stopped accidentally due to an errant 'V' character sent to /dev/watchdog by mistake.

Suggested Kconfig name: CONFIG_WATCHDOG_MAGIC_V.

This option could be enabled (=y) by default for simplicity, while being available for users who want to harden their config.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit 96ec698 into apache:master Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants