Received: by 10.223.185.116 with SMTP id b49csp514663wrg; Sat, 10 Feb 2018 12:13:11 -0800 (PST) X-Google-Smtp-Source: AH8x227NpIfR5dqZ8FzivpeLm7a/elHDqL7yAxGQKlTQe/t/IN7uz9pUq1vG/t6f5PkSIuSsQOxv X-Received: by 10.98.57.131 with SMTP id u3mr6827910pfj.237.1518293591158; Sat, 10 Feb 2018 12:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518293591; cv=none; d=google.com; s=arc-20160816; b=kt8tK2yL7EaBbq2KuF0Z6j4OnvhqcSvUWPR1O7EJzQgB+ijR2hcupH4qMdOsE2O3Jv VjJ74VHf2xlbxXYnaageHtBpIGJSKPotTrqTQ1F2JYENcCl8lzzJ1aMmDCeO6AyqLvuu Z/fog1O+prLPHmFzDyT6YKCjYwy3ZHgOof1aZCVkHXoJLmS9atQaLlHLboIrtz6dfrR7 u/jLu6L1Dj9X0d1gLG2lEDu6QjOtfckg4moDLsdxuPGLhvr/oJyiKUMqU0OLS+wLcLzC U1Vq5WQVUA6DsO8SFduCK2awN05QPoqOzwClya4axVAkgIV8d8CJlup96qe85ADHEp6z fdFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=r5K1zkMi7QQkXQy+Jc91BMN6cAJfH9MtB9R7YfUAuck=; b=et3NNxAtLqg3PD8UhvYMkjAtGmm/JNiQL1pJDTpKz3TF8h9xJ8Ra5B2/CU2n+4AoKo JHqs2GI8YsjIYfQa7RtUQmZVAPYKr6kA4wIGgxZlu7qwkUwZCLi1TT/x4W2YaTSw0rHV vhjZ+Ej6leVH3+foqRZNjLlB72GtAbl2bFc60O4KMOBy3Am6XJbZhmyg9MvbMZP4XOfJ MDInPGr65eOajCAiTEDk+p2iB5XbWBkHqHcby92Ajv8rS0F84ZYKMdF/6pXkk7b6jejI v9Hwt3HQhL32JsBHzTrpStfk22/fbXkyoZ71RzHm0bqVxz7dlAv67rH3sm8ku5R9+Uc+ nQZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mQlwKLxq; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27si1857803pfi.382.2018.02.10.12.12.57; Sat, 10 Feb 2018 12:13:11 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mQlwKLxq; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285AbeBJUMQ (ORCPT + 99 others); Sat, 10 Feb 2018 15:12:16 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:46857 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbeBJUMO (ORCPT ); Sat, 10 Feb 2018 15:12:14 -0500 Received: by mail-lf0-f67.google.com with SMTP id q194so15599777lfe.13; Sat, 10 Feb 2018 12:12:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=r5K1zkMi7QQkXQy+Jc91BMN6cAJfH9MtB9R7YfUAuck=; b=mQlwKLxqE8CHZZLLrX4HgumyjJhoKQzWInrYokfEkEaSNQEjFIk+FBFzHEKXvKXlKb 9ZzzAw/B1LX2mcw8xOUB7QkzC9Kxaswy+BJz2BFBDuh4iqbvZ/gwGhC79BRtCn5A0lZR Dzc7Z5R4z9I30QEJSItIHQFCymwYcx39WFrmrsM2XEcNZ0R47+gf85ao9hpgihr0SogQ ay31jurt+fReYmJ5Krs0p9UjCkqWfSkuWyt9hO+kPidD9Cv/9r1CG+cZXooxPnEnY0dl scR+VLjRc8Ibl72CA5Acq5ukvnE2Xkj7yJOTMMpBl6YF2sA6YI0LWC3IrRoqxrwz4YfH pyMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=r5K1zkMi7QQkXQy+Jc91BMN6cAJfH9MtB9R7YfUAuck=; b=lJXbg99SQfTVeEEdnqK5nNSdV4yz4tbpJ07//0ak5qUeVU6lYWZYit5+fO/ynOZLCW VFJV0l7GpbinYUG95GcGMmh3fcbAHUsVRHHEIKoZWJ+LqGBolBQ03ih9bNalF6kGDUmi z45qcumGLHUopTWGwlyMVenTpe17LezQLNNTsRl3htAR3oIlgKENf7904FNkJ/uqjRf0 QEzwtOgJmVCzQNwnr0OaNJKr/JUm/izEfk8BWk2A6xL4Iorn8nGhxDvdPWwMrBeRgHK3 E0k7cAIeKnPlDj1XsyCOpBPLryl9sAbSugdkgHHay3pBv08YJsYoGJYexb42XswweDPL qx6A== X-Gm-Message-State: APf1xPAZXhws60naHX6XTByevjIeWIvLIiqL2jpurgxpVjnrRY7Ml+5c WvIH4HBmwmDXdTv5OO75z8o= X-Received: by 10.46.2.1 with SMTP id 1mr4795222ljc.0.1518293532843; Sat, 10 Feb 2018 12:12:12 -0800 (PST) Received: from gmail.com ([46.194.112.145]) by smtp.gmail.com with ESMTPSA id i14sm919758ljb.33.2018.02.10.12.12.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Feb 2018 12:12:11 -0800 (PST) Date: Sat, 10 Feb 2018 21:12:07 +0100 From: Marcus Folkesson To: Sean Wang 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 , devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 5/7] watchdog: mtk: allow setting timeout in devicetree Message-ID: <20180210201207.GC744@gmail.com> References: <20180210091911.3644-1-marcus.folkesson@gmail.com> <20180210091911.3644-5-marcus.folkesson@gmail.com> <1518261002.9025.36.camel@mtkswgap22> <20180210124328.GB744@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w7PDEPdKQumQfZlR" Content-Disposition: inline In-Reply-To: <20180210124328.GB744@gmail.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --w7PDEPdKQumQfZlR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Sean, On Sat, Feb 10, 2018 at 01:43:28PM +0100, Marcus Folkesson wrote: > Hello Sean, >=20 > On Sat, Feb 10, 2018 at 07:10:02PM +0800, Sean Wang wrote: > >=20 > > Hi, Marcus > >=20 > > The changes you made for dt-bindings and driver should be put into > > separate patches. >=20 > I actually thought about it but chose to have it in the same patch becaus= e I > did not see any direct advantage to separating them. >=20 > But I can do that. > I will come up with a v3 with this change if no one thinks differently. >=20 When looking at the git log, I'm not that convinced it should be separate patches. For example, I found a4f741e3e157c3a5c8aea5f2ea62b692fbf17338 that is doing the exact same thing as this patch. There is plenty of patches that mixes the code change and dt bindings updates. Could it not be useful to overview both the implementation and dt-mapping change in one view? If you or anyone else still think it should be separated, please let me kno= w and I will come up with a v3. > >=20 > > 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. >=20 > It should be, but it requires that the driver is using > watchdog_init_timeout() to set timeout, most of the drivers does not. > Most drivers does not even use the watchdog API but register itself as > misc devices. >=20 > When we have all wdt drivers using the watchdog API, we should probably > move the dt-binding to a common document. >=20 > >=20 > > Sean > >=20 >=20 > Thanks, >=20 > Best regards > Marcus Folkesson >=20 > > 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. > > >=20 > > > By following best practice described in > > > Documentation/watchdog/watchdog-kernel-api.txt, it also > > > let us to set timout-sec property in devicetree. > > >=20 > > > 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(-) > > >=20 > > > 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: > > > =20 > > > - reg : Specifies base physical address and size of the registers. > > > =20 > > > +Optional properties: > > > +- timeout-sec: contains the watchdog timeout in seconds. > > > + > > > Example: > > > =20 > > > wdt: watchdog@10000000 { > > > compatible =3D "mediatek,mt6589-wdt"; > > > reg =3D <0x10000000 0x18>; > > > + timeout-sec =3D <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" > > > =20 > > > static bool nowayout =3D WATCHDOG_NOWAYOUT; > > > -static unsigned int timeout =3D WDT_MAX_TIMEOUT; > > > +static unsigned int timeout; > > > =20 > > > struct mtk_wdt_dev { > > > struct watchdog_device wdt_dev; > >=20 > >=20 Best regards Marcus Folkesson --w7PDEPdKQumQfZlR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEBVGi6LZstU1kwSxliIBOb1ldUjIFAlp/UhIACgkQiIBOb1ld UjLTSg//Y1Wdm+EzphVBNcQEOVuer5HfbnXLStbtYpcKsmz4gwjdx7vMhdmebUZg //6LIc3NBl/EowXi1zqR7/Eo57Xxd1iw5WxoRDHOqGeZtZ6BqdD3Rte240QhKnZX gFBNfeUgSjnCrzbdAOrKz2g6M4W9Bqb6C5XwTrO3KXp7eUPxffIQYCSkwt2FKlKy 5MMEonSISxDhgUXvB7p29BnZqCtAlrnwo/wgkug7kmON4059RaFBoRmAiJxO0GuE Z9ksVOFiOaUlM0zZpoCGoQAseFFv169s7JkVC9nphx3qu53i6/NqadyYdKqS6Dpz L8gCOZKSt93rILxYANfaUnec07oxQNOxrOLF8BfKaJJiKlkI+k/w5c3DijvEngbj 8KxtttCgVMxrwc7IQg3Mw5zlG7Z2go08JbSBrxyHWt0DE2k2VpBLDPaXFKPIMufg AyVsKPMfzms53w9sRtm8UMALc9fv7C4UIOKL9HHWIiicj6AHeUYU/0rpzyIJVPWU whIoLZWasSkke3vxVQkR61MX7/6S07L52sKGQAGI6I65oSeAsfT4lAA0PyydU5y6 Iuoqc2MvGw4jm8n0xVsrwBC/NVHweMejksZYhOgpPlRzY05qxce8KlVPX/s58w7E CxtbaDQNUTFCYa2B63fPqJqWR3jUR6y03caL3laEwEX4ZOvGd08= =6wc6 -----END PGP SIGNATURE----- --w7PDEPdKQumQfZlR--