diff options
author | Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> | 2016-10-07 08:39:54 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2016-10-08 04:27:10 -0400 |
commit | ff84136cb6a4943f489ad037fe93f43be0573c23 (patch) | |
tree | bde99dc52bf4066e666681d280011d37d17d269a /Documentation/watchdog/watchdog-kernel-api.txt | |
parent | fc113d54e9d7ef3296cdf2eff49c8ca0a3e5a482 (diff) |
watchdog: add watchdog pretimeout governor framework
The change adds a simple watchdog pretimeout framework infrastructure,
its purpose is to allow users to select a desired handling of watchdog
pretimeout events, which may be generated by some watchdog devices.
A user selects a default watchdog pretimeout governor during
compilation stage.
Watchdogs with WDIOF_PRETIMEOUT capability now have one more device
attribute in sysfs, pretimeout_governor attribute is intended to display
the selected watchdog pretimeout governor.
The framework has no impact at runtime on watchdog devices with no
WDIOF_PRETIMEOUT capability set.
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'Documentation/watchdog/watchdog-kernel-api.txt')
-rw-r--r-- | Documentation/watchdog/watchdog-kernel-api.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt index 3402dcad5b03..ea277478982f 100644 --- a/Documentation/watchdog/watchdog-kernel-api.txt +++ b/Documentation/watchdog/watchdog-kernel-api.txt | |||
@@ -48,6 +48,7 @@ struct watchdog_device { | |||
48 | const struct attribute_group **groups; | 48 | const struct attribute_group **groups; |
49 | const struct watchdog_info *info; | 49 | const struct watchdog_info *info; |
50 | const struct watchdog_ops *ops; | 50 | const struct watchdog_ops *ops; |
51 | const struct watchdog_governor *gov; | ||
51 | unsigned int bootstatus; | 52 | unsigned int bootstatus; |
52 | unsigned int timeout; | 53 | unsigned int timeout; |
53 | unsigned int pretimeout; | 54 | unsigned int pretimeout; |
@@ -75,6 +76,7 @@ It contains following fields: | |||
75 | * info: a pointer to a watchdog_info structure. This structure gives some | 76 | * info: a pointer to a watchdog_info structure. This structure gives some |
76 | additional information about the watchdog timer itself. (Like it's unique name) | 77 | additional information about the watchdog timer itself. (Like it's unique name) |
77 | * ops: a pointer to the list of watchdog operations that the watchdog supports. | 78 | * ops: a pointer to the list of watchdog operations that the watchdog supports. |
79 | * gov: a pointer to the assigned watchdog device pretimeout governor or NULL. | ||
78 | * timeout: the watchdog timer's timeout value (in seconds). | 80 | * timeout: the watchdog timer's timeout value (in seconds). |
79 | This is the time after which the system will reboot if user space does | 81 | This is the time after which the system will reboot if user space does |
80 | not send a heartbeat request if WDOG_ACTIVE is set. | 82 | not send a heartbeat request if WDOG_ACTIVE is set. |
@@ -288,3 +290,14 @@ User should follow the following guidelines for setting the priority: | |||
288 | * 128: default restart handler, use if no other handler is expected to be | 290 | * 128: default restart handler, use if no other handler is expected to be |
289 | available, and/or if restart is sufficient to restart the entire system | 291 | available, and/or if restart is sufficient to restart the entire system |
290 | * 255: highest priority, will preempt all other restart handlers | 292 | * 255: highest priority, will preempt all other restart handlers |
293 | |||
294 | To raise a pretimeout notification, the following function should be used: | ||
295 | |||
296 | void watchdog_notify_pretimeout(struct watchdog_device *wdd) | ||
297 | |||
298 | The function can be called in the interrupt context. If watchdog pretimeout | ||
299 | governor framework (kbuild CONFIG_WATCHDOG_PRETIMEOUT_GOV symbol) is enabled, | ||
300 | an action is taken by a preconfigured pretimeout governor preassigned to | ||
301 | the watchdog device. If watchdog pretimeout governor framework is not | ||
302 | enabled, watchdog_notify_pretimeout() prints a notification message to | ||
303 | the kernel log buffer. | ||