Received: by 10.223.185.116 with SMTP id b49csp94774wrg; Sat, 10 Feb 2018 03:11:41 -0800 (PST) X-Google-Smtp-Source: AH8x22712f0HeYuVlmjrM5SPh5q6VBT3pU33avvJzKklkM08x87lPGg98nKTWvlk9e4EqdlJF1BP X-Received: by 2002:a17:902:7889:: with SMTP id q9-v6mr5322267pll.114.1518261101515; Sat, 10 Feb 2018 03:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518261101; cv=none; d=google.com; s=arc-20160816; b=MmPhrSCm7t9fdDVvYj4GztfTpnCovTQpacvZYJYlvZPXiv/qPRlPDcegAqO4+zAlsP i58VXSxovv3QXHRmbQqGn+jQM23MNT+UpnVvXA1QTt5hJQ3PIHPGQ7howKG/Pb47V9nS okyEhrlOORGwTJNi5FFUUk4FC09A000p/EUYkQFHyxV/8CheMngLie3O71WBPVZNgoD+ xCcxi446YG30e5k/n9X4C+i/vkU4VdG/YKEkqe5tmUVQ2XZvwedKqXpvi/bIMM2QqQiz B24m4tUf02G+k1VD4+KN7Svz48mkFp1vgyEOZC9WjM/zhxN1hOStkR8ML6bldFLlgcOT bSMw== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=xTjLTzm5AP4B+laRtHQaO2dxXu7OkIaqUYLWC80lYpE=; b=OaXvJGX+kZ0/M98bxjKbctA5Nj1jytHgk7PjbuI3rlqW8BXgUpUN1VsNc3Oy0GH25q FXp+3kNsz2d9Sh5dEeteU9+3Lj6Ja9Sg5azVTJHHvBtb3BDn6SH2xhk5rJ8BnMvQwdJm 74hiPvFB69dV0LOlXn/zqcV0icYCcRcYu7ICGxEQ+fQlsYH5NJDXvEE3T5XOT/HUteAi QRLoJBzzMIByv4g3XWuJPWA5jKjBd0xQ/ujWpyNVcymjD6LyyAOlJHFevDCBSBqi+IBl usXeZuKRYBvC4xVczt+yPlAFmmU9sOOgY2VlE97lXYYYOGxk8jO1gWRIHh14nQFACI9R v0Cw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 204si2576671pgb.389.2018.02.10.03.11.27; Sat, 10 Feb 2018 03:11:41 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021AbeBJLKX (ORCPT + 99 others); Sat, 10 Feb 2018 06:10:23 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:4613 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751041AbeBJLKJ (ORCPT ); Sat, 10 Feb 2018 06:10:09 -0500 X-UUID: 06b3e4914d9842828f0bf09ac6ff9cec-20180210 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 727769042; Sat, 10 Feb 2018 19:10:03 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Sat, 10 Feb 2018 19:10:02 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Sat, 10 Feb 2018 19:10:02 +0800 Message-ID: <1518261002.9025.36.camel@mtkswgap22> Subject: Re: [PATCH v2 5/7] watchdog: mtk: allow setting timeout in devicetree From: Sean Wang To: Marcus Folkesson CC: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Mark Rutland , Carlo Caione , Kevin Hilman , Matthias Brugger , Barry Song , Maxime Ripard , Chen-Yu Tsai , Linus Walleij , "Vladimir Zapolskiy" , Sylvain Lemieux , Nicolas Ferre , Alexandre Belloni , , , , , , Date: Sat, 10 Feb 2018 19:10:02 +0800 In-Reply-To: <20180210091911.3644-5-marcus.folkesson@gmail.com> References: <20180210091911.3644-1-marcus.folkesson@gmail.com> <20180210091911.3644-5-marcus.folkesson@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Marcus The changes you made for dt-bindings and driver should be put into separate patches. And the property timeout-sec seems to be generic enough to all devices, so why not add a common document to describe it and allow those devices to refer to, like other dt-bindings for other kinds of devices usually did. Sean On Sat, 2018-02-10 at 10:19 +0100, Marcus Folkesson wrote: > watchdog_init_timeout() will allways pick timeout_param since it > defaults to a valid timeout. > > By following best practice described in > Documentation/watchdog/watchdog-kernel-api.txt, it also > let us to set timout-sec property in devicetree. > > Signed-off-by: Marcus Folkesson > Reviewed-by: Guenter Roeck > --- > Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 4 ++++ > drivers/watchdog/mtk_wdt.c | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt > index 5b38a30e608c..859dee167b91 100644 > --- a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt > +++ b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt > @@ -11,9 +11,13 @@ Required properties: > > - reg : Specifies base physical address and size of the registers. > > +Optional properties: > +- timeout-sec: contains the watchdog timeout in seconds. > + > Example: > > wdt: watchdog@10000000 { > compatible = "mediatek,mt6589-wdt"; > reg = <0x10000000 0x18>; > + timeout-sec = <10>; > }; > diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c > index 7ed417a765c7..fcdc10ec28a3 100644 > --- a/drivers/watchdog/mtk_wdt.c > +++ b/drivers/watchdog/mtk_wdt.c > @@ -57,7 +57,7 @@ > #define DRV_VERSION "1.0" > > static bool nowayout = WATCHDOG_NOWAYOUT; > -static unsigned int timeout = WDT_MAX_TIMEOUT; > +static unsigned int timeout; > > struct mtk_wdt_dev { > struct watchdog_device wdt_dev;