Skip to content

WDOG: Output status on read#19518

Open
Javinator9889 wants to merge 1 commit into
apache:masterfrom
Javinator9889:feat/wdog-read_return_current_status
Open

WDOG: Output status on read#19518
Javinator9889 wants to merge 1 commit into
apache:masterfrom
Javinator9889:feat/wdog-read_return_current_status

Conversation

@Javinator9889

Copy link
Copy Markdown
Contributor

Summary

Currently, the read function of the watchdog device is dummy and does nothing. Although this is fine, it's not useful at all from a userspace perspective, where you may want to check the current WDOG status.

A wrapper around the ioctl WDIOC_GETSTATUS has been added as the read function for the WDOG.

Impact

This should help debugging and developers with watchdog-enabled systems

Testing

The testing in this case is quite straightforward: cat /dev/watchdog0, whose output was:

nsh> cat /dev/watchdog0
Status       :
  flags      : 0x00000000
  timeout    : 30000
  timeleft   : 2947

@github-actions github-actions Bot added Area: Drivers Drivers issues Size: S The size of the change in this PR is small labels Jul 24, 2026
@Javinator9889
Javinator9889 force-pushed the feat/wdog-read_return_current_status branch 2 times, most recently from aa7c60e to ecc59cb Compare July 24, 2026 10:37
Comment thread drivers/timers/watchdog.c
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@Javinator9889 please squash your change into one patch.

Currently, the `read` function of the watchdog device is dummy and
does nothing. Although this is fine, it's not useful at all from a
userspace perspective, where you may want to check the current WDOG
status.

A wrapper around the `ioctl` `WDIOC_GETSTATUS` has been added as
the `read` function for the WDOG.

Signed-off-by: Javier Alonso <javieralonso@geotab.com>
@Javinator9889
Javinator9889 force-pushed the feat/wdog-read_return_current_status branch from bfb9a3d to 265caef Compare July 24, 2026 13:38
@Javinator9889

Copy link
Copy Markdown
Contributor Author

@xiaoxiang781216 squashed and force-pushed

@acassis acassis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Drivers Drivers issues Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants