summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2016-05-31 14:08:08 +0800
committerWim Van Sebroeck <wim@iguana.be>2016-07-17 20:59:40 +0200
commit1894cad9bf2c10359b2b7a0c00e564698f712751 (patch)
treed0824a3c189a66e55f6da7e870cd97cf4058a7df /drivers/watchdog
parentb7a8c420f31eaf521f66f093a1a00e92718dd193 (diff)
downloadblackbird-obmc-linux-1894cad9bf2c10359b2b7a0c00e564698f712751.tar.gz
blackbird-obmc-linux-1894cad9bf2c10359b2b7a0c00e564698f712751.zip
watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined
When max_hw_heartbeat_ms has a none zero value, max_timeout is not used. So it's value can be 0. In such case if a driver uses min_timeout functionality, then check will always fail. This patch fixes above issue. Signed-off-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Fu Wei <fu.wei@linaro.org> 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 'drivers/watchdog')
-rw-r--r--drivers/watchdog/watchdog_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index f4f02d2763ec..6abb83cd7681 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -88,7 +88,7 @@ static void watchdog_check_min_max_timeout(struct watchdog_device *wdd)
* Check that we have valid min and max timeout values, if
* not reset them both to 0 (=not used or unknown)
*/
- if (wdd->min_timeout > wdd->max_timeout) {
+ if (!wdd->max_hw_heartbeat_ms && wdd->min_timeout > wdd->max_timeout) {
pr_info("Invalid min and max timeout values, resetting to 0!\n");
wdd->min_timeout = 0;
wdd->max_timeout = 0;
OpenPOWER on IntegriCloud