diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2019-08-12 16:13:56 +0300 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2019-09-17 09:59:02 +0300 |
commit | 144783a80cd2cbc45c6ce17db649140b65f203dd (patch) | |
tree | 01942dff052a66458f2035da508f6a133378d534 /drivers/watchdog/imx_sc_wdt.c | |
parent | 68f28b01fb9e5fc3ec273104714bd71bac783845 (diff) | |
download | linux-144783a80cd2cbc45c6ce17db649140b65f203dd.tar.xz |
watchdog: imx2_wdt: fix min() calculation in imx2_wdt_set_timeout
Converting from ms to s requires dividing by 1000, not multiplying. So
this is currently taking the smaller of new_timeout and 1.28e8,
i.e. effectively new_timeout.
The driver knows what it set max_hw_heartbeat_ms to, so use that
value instead of doing a division at run-time.
FWIW, this can easily be tested by booting into a busybox shell and
doing "watchdog -t 5 -T 130 /dev/watchdog" - without this patch, the
watchdog fires after 130&127 == 2 seconds.
Fixes: b07e228eee69 "watchdog: imx2_wdt: Fix set_timeout for big timeout values"
Cc: stable@vger.kernel.org # 5.2 plus anything the above got backported to
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20190812131356.23039-1-linux@rasmusvillemoes.dk
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog/imx_sc_wdt.c')
0 files changed, 0 insertions, 0 deletions