[PATCH 4/5] docs: watchdog-kernel-api: general cleanups

From: Randy Dunlap

Date: Fri Feb 27 2026 - 20:05:53 EST


Fix grammar and punctuation.
Add a missing struct member (pm_nb) and its description.
Add a subheading for Helper Functions between the struct descriptions
and just pure helper functions.

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
---
Cc: Jonathan Corbet <corbet@xxxxxxx>
Cc: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
Cc: Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>
Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
Cc: linux-watchdog@xxxxxxxxxxxxxxx
Cc: linux-doc@xxxxxxxxxxxxxxx

Documentation/watchdog/watchdog-kernel-api.rst | 20 +++++++++------
1 file changed, 13 insertions(+), 7 deletions(-)

--- linux-next-20260226.orig/Documentation/watchdog/watchdog-kernel-api.rst
+++ linux-next-20260226/Documentation/watchdog/watchdog-kernel-api.rst
@@ -38,8 +38,8 @@ The watchdog_unregister_device routine d
device. The parameter of this routine is the pointer to the registered
watchdog_device structure.

-The watchdog subsystem includes an registration deferral mechanism,
-which allows you to register an watchdog as early as you wish during
+The watchdog subsystem includes a registration deferral mechanism,
+which allows you to register a watchdog as early as you wish during
the boot process.

The watchdog device structure looks like this::
@@ -60,13 +60,14 @@ The watchdog device structure looks like
unsigned int max_hw_heartbeat_ms;
struct notifier_block reboot_nb;
struct notifier_block restart_nb;
+ struct notifier_block pm_nb;
void *driver_data;
struct watchdog_core_data *wd_data;
unsigned long status;
struct list_head deferred;
};

-It contains following fields:
+It contains the following fields:

* id: set by watchdog_register_device, id 0 is special. It has both a
/dev/watchdog0 cdev (dynamic major, minor 0) as well as the old
@@ -105,6 +106,8 @@ It contains following fields:
internal use only. If a watchdog is capable of restarting the machine, it
should define ops->restart. Priority can be changed through
watchdog_set_restart_priority.
+* pm_nb: coordinates watchdog_dev_suspend/resume to cancel a ping worker
+ during suspend and restore it during resume.
* bootstatus: status of the device after booting (reported with watchdog
WDIOF_* status bits).
* driver_data: a pointer to the drivers private data of a watchdog device.
@@ -204,7 +207,7 @@ they are supported. These optional routi
If the watchdog driver does not have to perform any action but setting the
watchdog_device.timeout, this callback can be omitted.

- If set_timeout is not provided but, WDIOF_SETTIMEOUT is set, the watchdog
+ If set_timeout is not provided but WDIOF_SETTIMEOUT is set, the watchdog
infrastructure updates the timeout value of the watchdog_device internally
to the requested value.

@@ -220,7 +223,7 @@ they are supported. These optional routi
the watchdog". A value of 0 disables pretimeout notification.

(Note: the WDIOF_PRETIMEOUT needs to be set in the options field of the
- watchdog's info structure).
+ watchdog's info structure.)

If the watchdog driver does not have to perform any action but setting the
watchdog_device.pretimeout, this callback can be omitted. That means if
@@ -239,7 +242,7 @@ they are supported. These optional routi
The status bits should (preferably) be set with the set_bit and clear_bit alike
bit-operations. The status bits that are defined are:

-* WDOG_ACTIVE: this status bit indicates whether or not a watchdog timer device
+* WDOG_ACTIVE: this status bit indicates whether a watchdog timer device
is active or not from user perspective. User space is expected to send
heartbeat requests to the driver while this flag is set.
* WDOG_NO_WAY_OUT: this bit stores the nowayout setting for the watchdog.
@@ -254,6 +257,9 @@ bit-operations. The status bits that are
then opening /dev/watchdog will skip the start operation but send a keepalive
request instead.

+Helper Functions
+~~~~~~~~~~~~~~~~
+
To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog
timer device) you can either:

@@ -331,7 +337,7 @@ To raise a pretimeout notification, the
void watchdog_notify_pretimeout(struct watchdog_device *wdd)

The function can be called in the interrupt context. If watchdog pretimeout
-governor framework (kbuild CONFIG_WATCHDOG_PRETIMEOUT_GOV symbol) is enabled,
+governor framework (kconfig CONFIG_WATCHDOG_PRETIMEOUT_GOV symbol) is enabled,
an action is taken by a preconfigured pretimeout governor preassigned to
the watchdog device. If watchdog pretimeout governor framework is not
enabled, watchdog_notify_pretimeout() prints a notification message to