Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3980613ybc; Thu, 21 Nov 2019 17:19:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzOXLlbRRc8Mtr5ADGXxEnuU0XZRIEPP+yyKyxvkfd9cTHEP8n2Rtqa9WNKt8bblpGdJhLG X-Received: by 2002:a17:906:2615:: with SMTP id h21mr18335191ejc.212.1574385582836; Thu, 21 Nov 2019 17:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574385582; cv=none; d=google.com; s=arc-20160816; b=kXIILwxAzvsXi7UX3FmQ6OgWEAymvBfPSldJsNawnMPjBvlVVi1Blanc1sBIormWR2 /maVD4IlRo3HIzR2nTPFha45ipFDEGJH4afHPjiuLbBQE1H0eg2Zg4yu6TI/UdezisTW T7//MyQXVzrYmVUJM8ByPRbkuaRXW3Nx5gWmiOKEqDrrTqFHsUMikmAv3rT2mS4uqQPm iIlMmCYX8yA/0HhjU5Lc9EtabG1NpP3wXj0/sL+PA4E0oCfe5SQxujvzsss/Ea7qLIfi qMXZ9ZU5suTtYv9/Kn8Mq07kEhH6LDwEC074hZtqR4gTGbhYZI2139kuawceKBR6sL2C AfYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=w/q5mPFkX1/tLLoPJqOW9DTNzTeMq5c8JGI4Z1gKowc=; b=nn24hIIGj3NYqOkaznKMtl3hhQBKdlksdVGEn5u8hksNfc9wsfL7DRFcRFiwnn20+z jvjQm4q9F0MascEyOC1Sjyz46uGH7kweE+/+XFf/4+mVRawE86V6RJLMuau4OPGc7973 E2VuSunIDwswx0MIfWKPPf7VSaXIzRcHRGJuDQaRcr0fHVxzGAK+X6rqcI6LnWW3NBpR s82ipB4wD38xwyULObsxqDkqGOqnePAyH+JYw1E/kWFEawRobBMqRoXCSyk+Ztq9MMCg 1M2gkKrfhpnge6XgelDEN7GfYsePjrGCiFmArU6UY9UXtdnupsdGtxQ1Sh18PI7SqCng WN8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nokia-sbell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mh1si3143594ejb.221.2019.11.21.17.19.06; Thu, 21 Nov 2019 17:19:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nokia-sbell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbfKVBQj convert rfc822-to-8bit (ORCPT + 99 others); Thu, 21 Nov 2019 20:16:39 -0500 Received: from cnshjsmin05.app.nokia-sbell.com ([116.246.26.45]:60792 "EHLO cnshjsmin05.nokia-sbell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbfKVBQj (ORCPT ); Thu, 21 Nov 2019 20:16:39 -0500 X-AuditID: ac18929d-49dff700000014de-85-5dd736f3c3c1 Received: from CNSHPPEXCH1603.nsn-intra.net (Unknown_Domain [135.251.51.103]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by cnshjsmin05.nokia-sbell.com (Symantec Messaging Gateway) with SMTP id 90.DC.05342.3F637DD5; Fri, 22 Nov 2019 09:16:35 +0800 (HKT) Received: from CNSHPPEXCH1601.nsn-intra.net (135.251.51.101) by CNSHPPEXCH1603.nsn-intra.net (135.251.51.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 22 Nov 2019 09:16:35 +0800 Received: from CNSHPPEXCH1601.nsn-intra.net ([135.251.51.101]) by CNSHPPEXCH1601.nsn-intra.net ([135.251.51.101]) with mapi id 15.01.1713.007; Fri, 22 Nov 2019 09:16:35 +0800 From: "Wang, Peng 1. (NSB - CN/Hangzhou)" To: Guenter Roeck CC: Guenter Roeck , "wim@linux-watchdog.org" , "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value Thread-Topic: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value Thread-Index: AdWgVy1kREB4bw5dQ4u+4ZEezt20u///t7KA//7BtxA= Date: Fri, 22 Nov 2019 01:16:34 +0000 Message-ID: References: <20191121141508.GA13249@roeck-us.net> In-Reply-To: <20191121141508.GA13249@roeck-us.net> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [135.251.51.115] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsXS/ts4Xfez2fVYg5VLzS32dV5nsri8aw6b xY11+9gtniw8w2Tx+OU/ZgdWj52z7rJ7rFyzBsj63sDu8XmTXABLFJdNSmpOZllqkb5dAlfG /6W3WQomC1ccPveGvYHxLH8XIyeHhICJRNv7CYxdjFwcQgKHmCQ2XjvADOH8ZZS4vuY7lLOJ UWLSt6tsIC1sAu4STZvWgdkiAmoSzada2ECKmAUeMEq8P7IXyOHgEBZIkfjSwQNRkyrxbcIB JgjbSuLlqy1gNouAqsTX3n5GEJtXwE5i0f8pjCCtQgJpEl//pIOEOQWMJE6vuMsKYjMKyEpM e3QfrJVZQFzi1pP5TBAfCEgs2XOeGcIWlXj5+B8ryBgJASWJvg1Q5ToSC3Z/YoOwtSWWLXzN DLFVUOLkzCcsExjFZiGZOgtJyywkLbOQtCxgZFnFKJ2cV5yRVZybmWdgqpeXn52ZqFuclJqT o5ecn7uJERh7ayQmzd3B2NkZf4hRgINRiYf3ReW1WCHWxLLiytxDjBIczEoivHuuX4kV4k1J rKxKLcqPLyrNSS0+xCjNwaIkztsyeWGskEB6YklqdmpqQWoRTJaJg1OqgVF0wzel59+iXU64 bv0qpzA1Y+HJRdqh/6dmMhaEGioeOuhxMbLHqrXkdvU0feWvU0W4lRlXMkrtOdWYzaR6ou1t /pEfn/9K3ONaVbGzzIfV6tnHMN34FdKrb+96ovtHKcrhQVtizeT7xz84Fe3bXDnHqSHzx2r+ 7XZLJNTX1Ns+nagjUZWRuEmJpTgj0VCLuag4EQCPDo//uQIAAA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Reviewed-by: Guenter Roeck Roeck, thanks for your time to guide me to finish the review. Do I need to re-send a mail with your sign? Peng Wang -----Original Message----- From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter Roeck Sent: Thursday, November 21, 2019 10:15 PM To: Wang, Peng 1. (NSB - CN/Hangzhou) Cc: Guenter Roeck ; wim@linux-watchdog.org; linux-watchdog@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value On Thu, Nov 21, 2019 at 10:35:12AM +0000, Wang, Peng 1. (NSB - CN/Hangzhou) wrote: > From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 2001 > From: Peng Wang > Date: Wed, 20 Nov 2019 15:12:59 +0800 > Subject: [PATCH] watchdog: make DesignWare watchdog allow users to set > bigger timeout value > > watchdog_dev.c provides means to allow users to set bigger timeout > value than HW can support, make DesignWare watchdog align with this. > > --- > > v2 -> v1: > - use top_s to compare with wdd->max_hw_heartbeat_ms > - update wdd->timeout in case it's greater than HW supports > - fix comments error > > v1: initial version > > Signed-off-by: Peng Wang Reviewed-by: Guenter Roeck > --- > drivers/watchdog/dw_wdt.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c > index fef7c61..12c116e 100644 > --- a/drivers/watchdog/dw_wdt.c > +++ b/drivers/watchdog/dw_wdt.c > @@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s) > writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT, > dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET); > > - wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val); > + /* > + * In case users set bigger timeout value than HW can support, > + * kernel(watchdog_dev.c) helps to feed watchdog before > + * wdd->max_hw_heartbeat_ms > + */ > + if ( top_s * 1000 <= wdd->max_hw_heartbeat_ms ) > + wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val); > + else > + wdd->timeout = top_s; > > return 0; > } > -- > 1.8.3.1 >