linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: fu.wei@linaro.org (fu.wei at linaro.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined
Date: Tue, 31 May 2016 14:08:08 +0800	[thread overview]
Message-ID: <1464674890-10512-2-git-send-email-fu.wei@linaro.org> (raw)
In-Reply-To: <1464674890-10512-1-git-send-email-fu.wei@linaro.org>

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

  reply	other threads:[~2016-05-31  6:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31  6:08 [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog fu.wei at linaro.org
2016-05-31  6:08 ` fu.wei at linaro.org [this message]
2016-06-01 21:40   ` [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined Guenter Roeck
2016-05-31  6:08 ` [PATCH 2/3] sbsa_gwdt: Use max_hw_heartbeat_ms instead of max_timeout fu.wei at linaro.org
2016-06-01 21:43   ` Guenter Roeck
2016-05-31  6:08 ` [PATCH 3/3] sbsa_gwdt: Set WDOG_HW_RUNNING, when watchdog is already running fu.wei at linaro.org
2016-06-01 21:43   ` Guenter Roeck
     [not found] ` <20160717195139.GC32751@spo001.leaseweb.nl>
2016-07-18 15:21   ` [PATCH 0/3] watchdog, sbsa_gwdt: Update SBSA watchdog with the new infrastructure of watchdog Fu Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464674890-10512-2-git-send-email-fu.wei@linaro.org \
    --to=fu.wei@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).