diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2016-08-31 07:52:41 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2016-09-24 03:27:15 -0400 |
commit | df044e02206230c7d79a9aef96a6c087476f5533 (patch) | |
tree | e1e6868b6d5a86c588457dc2b8c90418a6c8f02c /Documentation/watchdog | |
parent | 68d4cb809ef84f9a0ea6a23c4c0dc0ae48355f78 (diff) |
watchdog: add pretimeout support to the core
Since the watchdog framework centrializes the IOCTL interfaces of device
drivers now, SETPRETIMEOUT and GETPRETIMEOUT need to be added in the
common code.
Signed-off-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[vzapolskiy: added conditional pretimeout sysfs attribute visibility]
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'Documentation/watchdog')
-rw-r--r-- | Documentation/watchdog/watchdog-kernel-api.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt index 7f31125c123e..3402dcad5b03 100644 --- a/Documentation/watchdog/watchdog-kernel-api.txt +++ b/Documentation/watchdog/watchdog-kernel-api.txt | |||
@@ -50,6 +50,7 @@ struct watchdog_device { | |||
50 | const struct watchdog_ops *ops; | 50 | const struct watchdog_ops *ops; |
51 | unsigned int bootstatus; | 51 | unsigned int bootstatus; |
52 | unsigned int timeout; | 52 | unsigned int timeout; |
53 | unsigned int pretimeout; | ||
53 | unsigned int min_timeout; | 54 | unsigned int min_timeout; |
54 | unsigned int max_timeout; | 55 | unsigned int max_timeout; |
55 | unsigned int min_hw_heartbeat_ms; | 56 | unsigned int min_hw_heartbeat_ms; |
@@ -77,6 +78,7 @@ It contains following fields: | |||
77 | * timeout: the watchdog timer's timeout value (in seconds). | 78 | * timeout: the watchdog timer's timeout value (in seconds). |
78 | This is the time after which the system will reboot if user space does | 79 | This is the time after which the system will reboot if user space does |
79 | not send a heartbeat request if WDOG_ACTIVE is set. | 80 | not send a heartbeat request if WDOG_ACTIVE is set. |
81 | * pretimeout: the watchdog timer's pretimeout value (in seconds). | ||
80 | * min_timeout: the watchdog timer's minimum timeout value (in seconds). | 82 | * min_timeout: the watchdog timer's minimum timeout value (in seconds). |
81 | If set, the minimum configurable value for 'timeout'. | 83 | If set, the minimum configurable value for 'timeout'. |
82 | * max_timeout: the watchdog timer's maximum timeout value (in seconds), | 84 | * max_timeout: the watchdog timer's maximum timeout value (in seconds), |
@@ -121,6 +123,7 @@ struct watchdog_ops { | |||
121 | int (*ping)(struct watchdog_device *); | 123 | int (*ping)(struct watchdog_device *); |
122 | unsigned int (*status)(struct watchdog_device *); | 124 | unsigned int (*status)(struct watchdog_device *); |
123 | int (*set_timeout)(struct watchdog_device *, unsigned int); | 125 | int (*set_timeout)(struct watchdog_device *, unsigned int); |
126 | int (*set_pretimeout)(struct watchdog_device *, unsigned int); | ||
124 | unsigned int (*get_timeleft)(struct watchdog_device *); | 127 | unsigned int (*get_timeleft)(struct watchdog_device *); |
125 | int (*restart)(struct watchdog_device *); | 128 | int (*restart)(struct watchdog_device *); |
126 | void (*ref)(struct watchdog_device *) __deprecated; | 129 | void (*ref)(struct watchdog_device *) __deprecated; |
@@ -188,6 +191,23 @@ they are supported. These optional routines/operations are: | |||
188 | If set_timeout is not provided but, WDIOF_SETTIMEOUT is set, the watchdog | 191 | If set_timeout is not provided but, WDIOF_SETTIMEOUT is set, the watchdog |
189 | infrastructure updates the timeout value of the watchdog_device internally | 192 | infrastructure updates the timeout value of the watchdog_device internally |
190 | to the requested value. | 193 | to the requested value. |
194 | If the pretimeout feature is used (WDIOF_PRETIMEOUT), then set_timeout must | ||
195 | also take care of checking if pretimeout is still valid and set up the timer | ||
196 | accordingly. This can't be done in the core without races, so it is the | ||
197 | duty of the driver. | ||
198 | * set_pretimeout: this routine checks and changes the pretimeout value of | ||
199 | the watchdog. It is optional because not all watchdogs support pretimeout | ||
200 | notification. The timeout value is not an absolute time, but the number of | ||
201 | seconds before the actual timeout would happen. It returns 0 on success, | ||
202 | -EINVAL for "parameter out of range" and -EIO for "could not write value to | ||
203 | the watchdog". A value of 0 disables pretimeout notification. | ||
204 | (Note: the WDIOF_PRETIMEOUT needs to be set in the options field of the | ||
205 | watchdog's info structure). | ||
206 | If the watchdog driver does not have to perform any action but setting the | ||
207 | watchdog_device.pretimeout, this callback can be omitted. That means if | ||
208 | set_pretimeout is not provided but WDIOF_PRETIMEOUT is set, the watchdog | ||
209 | infrastructure updates the pretimeout value of the watchdog_device internally | ||
210 | to the requested value. | ||
191 | * get_timeleft: this routines returns the time that's left before a reset. | 211 | * get_timeleft: this routines returns the time that's left before a reset. |
192 | * restart: this routine restarts the machine. It returns 0 on success or a | 212 | * restart: this routine restarts the machine. It returns 0 on success or a |
193 | negative errno code for failure. | 213 | negative errno code for failure. |