Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1409814 > unrolled thread

[PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined

Started byfu.wei@linaro.org
First post2016-05-31 08:10 +0200
Last post2016-06-01 23:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined fu.wei@linaro.org - 2016-05-31 08:10 +0200
    Re: [PATCH 1/3] watchdog: skip min and max timeout validity check  when max_hw_heartbeat_ms is defined Guenter Roeck <linux@roeck-us.net> - 2016-06-01 23:50 +0200

#1409814 — [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined

Fromfu.wei@linaro.org
Date2016-05-31 08:10 +0200
Subject[PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined
Message-ID<rEL2h-75S-1@gated-at.bofh.it>
From: Pratyush Anand <panand@redhat.com>

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>
---
 drivers/watchdog/watchdog_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index 7c3ba58..65e62d1 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;
-- 
2.5.5

[toc] | [next] | [standalone]


#1411582 — Re: [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined

FromGuenter Roeck <linux@roeck-us.net>
Date2016-06-01 23:50 +0200
SubjectRe: [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined
Message-ID<rFmbx-5DL-77@gated-at.bofh.it>
In reply to#1409814
On Tue, May 31, 2016 at 02:08:08PM +0800, fu.wei@linaro.org wrote:
> From: Pratyush Anand <panand@redhat.com>
> 
> 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>

> ---
>  drivers/watchdog/watchdog_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
> index 7c3ba58..65e62d1 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;
> -- 
> 2.5.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web