Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2937911ybc; Thu, 21 Nov 2019 00:23:08 -0800 (PST) X-Google-Smtp-Source: APXvYqw6LrFjmltRwymVbva4hObEiZYoxtwaYBTBX5nxsVqvUOOF9tPmUKxHWZHY47SzfS7+kLC2 X-Received: by 2002:a17:906:25cb:: with SMTP id n11mr11606190ejb.239.1574324588527; Thu, 21 Nov 2019 00:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574324588; cv=none; d=google.com; s=arc-20160816; b=NN55ultoZZY4SUZA8qknHYAAy1o668x2Hdm7YY459/iVPIkRUAp5+gfY/gTF77ByGF mjMDiIaV+6XxtmupaMYnbm6yD7nZpcvdZshwGjNd22aoy2phuP8YbyOxzwNffcnuQgwy pGD9nPR2exqEg35a3T5cWFnhuWDbCExwQsxsEVwIivLIkKsyjPH2G/uAFxfol4UoOfh1 lpRwULpVmldLi6mZJ85u+bfpT3EYFXtH5sRp5l3aZUD0oXuR6YjiOv00078y82l8+fG2 dBkenGRZRDH6O0Td3ytQ2Z2vw8Ce8EvaHtR/sZE1vi43wc7t1uMYuw6pxr1XHdmhuQi6 nH9Q== 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:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=58JZhiP3VzEcgDsIeqqt/T8CYbhzbkVWCQKwHAJt2lQ=; b=qM/C/cEDl6+07mhr4Sgqg2nh3nled5/mv8+UU41+88g4Z7f/YJCubvqbn2dE5zm8cr xOGoNJQMLAZhd/Uz0qOB0g6PkM6vvvaTOYZhR1BI5LhiHpBYhmUKMBlJ0mGVlTgODPoU /YcXSdxiwsoADR9rUOTRIEE+4U1pKP7KAVqQ3VMNGQAj6YXDpYZjh2h/nnNnwmddvmET APnGL27GMiHQLa8wcvdL7Gf6YETV1VwAXf5rWinm/LxNO0xmw3c7p3KGGOvpOB9TJdPI lLZfY5+AAoNDXwnYSt+Qb/xzrW12t684hKMaZ9UR21Cd4dbYUimsLLghbLIQ7SjhrJ+N 142g== 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 qh13si1251532ejb.407.2019.11.21.00.22.44; Thu, 21 Nov 2019 00:23:08 -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 S1726500AbfKUIVf convert rfc822-to-8bit (ORCPT + 99 others); Thu, 21 Nov 2019 03:21:35 -0500 Received: from cnshjsmin05.nokia-sbell.com ([116.246.26.45]:14507 "EHLO cnshjsmin05.nokia-sbell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfKUIVf (ORCPT ); Thu, 21 Nov 2019 03:21:35 -0500 X-AuditID: ac18929d-483ff700000014de-16-5dd6490b9a27 Received: from CNSHPPEXCH1604.nsn-intra.net (Unknown_Domain [135.251.51.104]) (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 E9.B5.05342.B0946DD5; Thu, 21 Nov 2019 16:21:31 +0800 (HKT) Received: from CNSHPPEXCH1601.nsn-intra.net (135.251.51.101) by CNSHPPEXCH1604.nsn-intra.net (135.251.51.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 21 Nov 2019 16:21:30 +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; Thu, 21 Nov 2019 16:21:30 +0800 From: "Wang, Peng 1. (NSB - CN/Hangzhou)" To: Guenter Roeck CC: "wim@linux-watchdog.org" , "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] watchdog: make DesignWare watchdog allow users to set bigger timeout value Thread-Topic: [PATCH] watchdog: make DesignWare watchdog allow users to set bigger timeout value Thread-Index: AdWgRKybru2HRl6jT8acRiZ9mycWxQ== Date: Thu, 21 Nov 2019 08:21:30 +0000 Message-ID: <4468f40ed5f5413ab27825bbcc611d65@nokia-sbell.com> 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+NgFmpjkeLIzCtJLcpLzFFi42Jp/22cocvteS3W4Mwsdot9ndeZLC7vmsNm cWPdPnaLxy//MTuweOycdZfdY+WaNawenzfJBTBHcdmkpOZklqUW6dslcGXcXv6JueACV8XW 12+ZGxjfcHQxcnJICJhIbP28k62LkYtDSOAQk8StnStYIZy/jBLdTzuZIZxNjBJLb3cwg7Sw CbhLNG1axwZiiwioSuzbsRKsiFlgN6PE3MY3LCAJYYFYia97vzBDFCVJ3Hj4nwXC1pP4vXwy I4jNAtR84fJesBpeATuJGW0vWEFsRgFZiWmP7jOB2MwC4hK3nsxngrhVQGLJnvPMELaoxMvH /4DqOYBsJYm+DVDlOhILdn9ig7C1JZYtfA01XlDi5MwnLBMYRWYhmToLScssJC2zkLQsYGRZ xSidnFeckVWcm5lnYKqXl5+dmahbnJSak6OXnJ+7iREYO2skJs3dwdjZGX+IUYCDUYmHN0Pj aqwQa2JZcWXuIUYJDmYlEd4916/ECvGmJFZWpRblxxeV5qQWH2KU5mBREudtmbwwVkggPbEk NTs1tSC1CCbLxMEp1cDoF5x13jrv8ENrPbWM+KmflnDeyzLrd60U3WV98r/nX+tTs9iXJF76 YzEl6Nv7s5Mma94LePRuzjqnFMnrTSt/5CvtPLtzvsyLtFP3G1VzM4OCTu8+dWjmM1cjTt9G hXevVB721eeZKJ4uL1y17rVnqUTFXCUW+Qqm0KPst6JCXbLllYp1MzqUWIozEg21mIuKEwG1 HR5YmQIAAA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From d21d084122d08816454a1e338f0946a9da1f81e3 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. Signed-off-by: Peng Wang --- 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..f1a431c 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->timeout + */ + 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