mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
watchdog: watchdog_dev: Let the driver update the timeout field on set_timeout success
When a set_timeout operation succeeds this does not necessarily mean that the exact timeout requested has been achieved, because the watchdog does not necessarily have a 1 second resolution. So rather then have the core set the timeout member of the watchdog_device struct to the exact requested value, instead the driver should set it to the actually achieved timeout value. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
parent
a5132cafc0
commit
b10f7c12e0
2 changed files with 4 additions and 4 deletions
|
@ -117,9 +117,10 @@ they are supported. These optional routines/operations are:
|
||||||
status of the device is reported with watchdog WDIOF_* status flags/bits.
|
status of the device is reported with watchdog WDIOF_* status flags/bits.
|
||||||
* set_timeout: this routine checks and changes the timeout of the watchdog
|
* set_timeout: this routine checks and changes the timeout of the watchdog
|
||||||
timer device. It returns 0 on success, -EINVAL for "parameter out of range"
|
timer device. It returns 0 on success, -EINVAL for "parameter out of range"
|
||||||
and -EIO for "could not write value to the watchdog". On success the timeout
|
and -EIO for "could not write value to the watchdog". On success this
|
||||||
value of the watchdog_device will be changed to the value that was just used
|
routine should set the timeout value of the watchdog_device to the
|
||||||
to re-program the watchdog timer device.
|
achieved timeout value (which may be different from the requested one
|
||||||
|
because the watchdog does not necessarily has a 1 second resolution).
|
||||||
(Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the
|
(Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the
|
||||||
watchdog's info structure).
|
watchdog's info structure).
|
||||||
* ioctl: if this routine is present then it will be called first before we do
|
* ioctl: if this routine is present then it will be called first before we do
|
||||||
|
|
|
@ -226,7 +226,6 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
|
||||||
err = wdd->ops->set_timeout(wdd, val);
|
err = wdd->ops->set_timeout(wdd, val);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
wdd->timeout = val;
|
|
||||||
/* If the watchdog is active then we send a keepalive ping
|
/* If the watchdog is active then we send a keepalive ping
|
||||||
* to make sure that the watchdog keep's running (and if
|
* to make sure that the watchdog keep's running (and if
|
||||||
* possible that it takes the new timeout) */
|
* possible that it takes the new timeout) */
|
||||||
|
|
Loading…
Reference in a new issue