public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: mosipov@ilbers.de (Maxim Yu. Osipov)
To: cip-dev@lists.cip-project.org
Subject: [cip-dev] [PATCH 06/10] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined
Date: Wed,  4 Oct 2017 16:41:00 +0200	[thread overview]
Message-ID: <20171004144104.14403-7-mosipov@ilbers.de> (raw)
In-Reply-To: <20171004144104.14403-1-mosipov@ilbers.de>

From: Pratyush Anand <panand@redhat.com>

Backport from kernel.org, upstream commit 1894cad9bf2c

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>
[mosipov at ilbers.de backported to 4.4.y]
Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>
---
 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 41f1854d026b..5de14c51bf95 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.11.0

  parent reply	other threads:[~2017-10-04 14:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 14:40 [cip-dev] [PATCH 00/10] Backport of watchdog core triggered keepalive infrastructure Maxim Yu. Osipov
2017-10-04 14:40 ` [cip-dev] [PATCH 01/10] watchdog: Introduce hardware maximum heartbeat in watchdog core Maxim Yu. Osipov
2017-10-04 14:40 ` [cip-dev] [PATCH 02/10] watchdog: Introduce WDOG_HW_RUNNING flag Maxim Yu. Osipov
2017-10-25  9:43   ` Ben Hutchings
2017-10-04 14:40 ` [cip-dev] [PATCH 03/10] watchdog: Make stop function optional Maxim Yu. Osipov
2017-10-04 14:40 ` [cip-dev] [PATCH 04/10] watchdog: imx2: Convert to use infrastructure triggered keepalives Maxim Yu. Osipov
2017-10-04 14:40 ` [cip-dev] [PATCH 05/10] watchdog: core: Fix circular locking dependency Maxim Yu. Osipov
2017-10-04 14:41 ` Maxim Yu. Osipov [this message]
2017-10-04 14:41 ` [cip-dev] [PATCH 07/10] watchdog: change watchdog_need_worker logic Maxim Yu. Osipov
2017-10-04 14:41 ` [cip-dev] [PATCH 08/10] watchdog: core: Fix error handling of watchdog_dev_init() Maxim Yu. Osipov
2017-10-04 14:41 ` [cip-dev] [PATCH 09/10] watchdog: core: Clear WDOG_HW_RUNNING before calling the stop function Maxim Yu. Osipov
2017-10-04 14:41 ` [cip-dev] [PATCH 10/10] watchdog: core: add option to avoid early handling of watchdog Maxim Yu. Osipov
2017-10-09 15:00 ` [cip-dev] [PATCH 00/10] Backport of watchdog core triggered keepalive infrastructure Ben Hutchings
2017-10-09 15:26   ` Jan Kiszka
2017-10-25  9:46 ` Ben Hutchings
  -- strict thread matches above, loose matches on Subject: below --
2017-11-10 12:09 [cip-dev] [PATCH 00/10] Backport of watchdog core triggered keepalive infrastructure v2 Maxim Yu. Osipov
2017-11-10 12:10 ` [cip-dev] [PATCH 06/10] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined Maxim Yu. Osipov

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=20171004144104.14403-7-mosipov@ilbers.de \
    --to=mosipov@ilbers.de \
    --cc=cip-dev@lists.cip-project.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