From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from bh-25.webhostbox.net ([208.91.199.152]:60501 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824AbcFAVkN (ORCPT ); Wed, 1 Jun 2016 17:40:13 -0400 Date: Wed, 1 Jun 2016 14:40:08 -0700 From: Guenter Roeck To: fu.wei@linaro.org Cc: wim@iguana.be, panand@redhat.com, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-acpi@lists.linaro.org, timur@codeaurora.org, dyoung@redhat.com, graeme.gregory@linaro.org, al.stone@linaro.org, jcm@redhat.com, Suravee.Suthikulpanit@amd.com Subject: Re: [PATCH 1/3] watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined Message-ID: <20160601214008.GA2841@roeck-us.net> References: <1464674890-10512-1-git-send-email-fu.wei@linaro.org> <1464674890-10512-2-git-send-email-fu.wei@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464674890-10512-2-git-send-email-fu.wei@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org List-Id: linux-watchdog@vger.kernel.org On Tue, May 31, 2016 at 02:08:08PM +0800, fu.wei@linaro.org wrote: > From: Pratyush Anand > > 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 > Signed-off-by: Fu Wei Reviewed-by: Guenter Roeck > --- > 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