Commit 1894cad9 authored by Pratyush Anand's avatar Pratyush Anand Committed by Wim Van Sebroeck

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: default avatarPratyush Anand <panand@redhat.com>
Signed-off-by: default avatarFu Wei <fu.wei@linaro.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent b7a8c420
...@@ -88,7 +88,7 @@ static void watchdog_check_min_max_timeout(struct watchdog_device *wdd) ...@@ -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 * Check that we have valid min and max timeout values, if
* not reset them both to 0 (=not used or unknown) * 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"); pr_info("Invalid min and max timeout values, resetting to 0!\n");
wdd->min_timeout = 0; wdd->min_timeout = 0;
wdd->max_timeout = 0; wdd->max_timeout = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment