Received: by 10.223.185.116 with SMTP id b49csp166016wrg; Sat, 10 Feb 2018 04:45:05 -0800 (PST) X-Google-Smtp-Source: AH8x227jXxRl77jErKuv4MBGzAZQN8bYi6G30YYxyd3dmddfHunWPmYk7YPtg878wn1CclJuaLPN X-Received: by 10.98.0.17 with SMTP id 17mr5913203pfa.63.1518266705077; Sat, 10 Feb 2018 04:45:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518266705; cv=none; d=google.com; s=arc-20160816; b=Hw7oU4ciMo3pGVHzOFgcZC27tRlVH/HXueDqOHDyHVOtYHXJShH10WRQlLGDCfJKDZ Zo1BDOc2LJEAjaYhRvb188SG4TerhoyxYM+9RuPj5WyU713cYnPuQOY1uXd6TZxc/zi3 6Z3JvDuhrOSOcizpfe7TMxtDjncuodNhFGbHXW7KOH81W/J5/56MfKuBhqkVsPFVgTFB n0MjTjixwXA58Xe5xBlQBJwRGwzOAORSzXFMvEuby+rB3LKdfAYWuMYkOJyfUporgXJE +GzklXOXILGIWUfOI3uKZLNR8pYB2YCTyKAdWQjrfZ4IcsocF9q5sgIXGlSM3d89+AXy /ymw== 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=tb6rp7h0wsETPTHN49W83H4C6vypM2dzlyC9s6pFAxs=; b=0DyXIavWqr7obWHSBpsi85PoY9RJtszUKF8FVn32koCrkHR+ZJQGDTVfn+FIG7lsAP milFeR2gbqG6Q/Wh8s+gtsmAyvsKOlBeZs+J/2VAziukolSwZmO3XWv396fmsFb2DlFQ B9k55O/sODTMdi603NV0F5gN5FRPnIXM2tIyH4ZQ92tayveFkX2LC9DMzyamWkHKsCKE Pik5U1vvEQkmx8NBswIPvEamEWk4Yo5P1ErKLDpDbbCvmK6LMKUVP3mUBpAlkoOTW98Z fqzuwdLNM0e9VaDZmWdW6phcdN4XKg1kamU0Mvne5SqfrmpZJ7xL+0pgT+rvNE+B1Qwi MXeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DZGaGQZv; 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 o5si1426617pgp.243.2018.02.10.04.44.40; Sat, 10 Feb 2018 04:45:05 -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=DZGaGQZv; 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 S1751149AbeBJMng (ORCPT + 99 others); Sat, 10 Feb 2018 07:43:36 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:38046 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbeBJMne (ORCPT ); Sat, 10 Feb 2018 07:43:34 -0500 Received: by mail-lf0-f68.google.com with SMTP id g72so14770393lfg.5; Sat, 10 Feb 2018 04:43:33 -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=tb6rp7h0wsETPTHN49W83H4C6vypM2dzlyC9s6pFAxs=; b=DZGaGQZv1P9UKjYe1dm0It+FvEzpw/O3h5xUsbt+jtVUm4AMpwva9ncn1cEzUIQmHy 9u3Ww30ta8JD5IiQuhvH07D4UdpOqbvkzii9hkIfXegpNno5AExgiQLgpCTv+EIomm8O fS8vctx7ooHxVQJs23Ux3HzplwJSThV2sNmNGvSYYqJSMo5c/w4GGfRKxI3qBqHgMNM+ 1a3NXINkx3jquRePMhPXHBZBA5uyZYev7U7lP53HgqqzfIBTc1kY9kyw0sE3qufItlrD 4B2tjVO2CC0zv60pxASpkzjSSLL+QP2eNkE88oTXc7xiYwUva1V2+pNMn5sSeqveJ4bA TKcQ== 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=tb6rp7h0wsETPTHN49W83H4C6vypM2dzlyC9s6pFAxs=; b=G+zn0rRMKpEoeo05mij000gx4ofHLpd+ojorMXnX7gl61b0COYLVQ31bTV0uQ7kTgM fpyPtuU3mvQhlvFvJ382At6DjjXzy9QkmeDwzg8KBDCJOkT77DEcScftfJIkWb+L3+dv ZL2A8d4YtRgafBR8nL8sDE7wz6gU+cR+k6vAcfIVb5yA4kcba2H4eX6fJkICSJkbjZxy 29bM+FzEatavPr1q/cwjhvSQVHE+rMjbepJcQd/aP5rpp22hznkcNE27bqv4VvSuyj+V Efy8d8SnaUhNjscVdCoVbaYO2dWk+2kWHtPkmWj8hvDz1QPGnfHfwLbCZ/HoGVwo/oN2 2Qhw== X-Gm-Message-State: APf1xPBGiwyj5iCZ9f+gaJURBLu9V4vmc36iPgPjAuC520x0dY6JcFxS ibNobP6uwY99ImAcN/f0p2I= X-Received: by 10.46.77.149 with SMTP id c21mr4257310ljd.148.1518266612930; Sat, 10 Feb 2018 04:43:32 -0800 (PST) Received: from gmail.com (c-2ec27091-74736162.cust.telenor.se. [46.194.112.145]) by smtp.gmail.com with ESMTPSA id s14sm802718ljs.1.2018.02.10.04.43.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Feb 2018 04:43:31 -0800 (PST) Date: Sat, 10 Feb 2018 13:43:28 +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: <20180210124328.GB744@gmail.com> References: <20180210091911.3644-1-marcus.folkesson@gmail.com> <20180210091911.3644-5-marcus.folkesson@gmail.com> <1518261002.9025.36.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Y7xTucakfITjPcLV" Content-Disposition: inline In-Reply-To: <1518261002.9025.36.camel@mtkswgap22> 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 --Y7xTucakfITjPcLV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Sean, 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. I actually thought about it but chose to have it in the same patch because I did not see any direct advantage to separating them. But I can do that. I will come up with a v3 with this change if no one thinks differently. >=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. 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. When we have all wdt drivers using the watchdog API, we should probably move the dt-binding to a common document. >=20 > Sean >=20 Thanks, Best regards Marcus Folkesson > 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/D= ocumentation/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 --Y7xTucakfITjPcLV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEBVGi6LZstU1kwSxliIBOb1ldUjIFAlp+6OoACgkQiIBOb1ld UjLSJRAAxUO1qMHNhPF/4u4zm7H9yVubohdg5d8jCJWRSsijTea8V7Tmrz8VrCl2 3zLKSC1q66PaKG8nx7GwPe0cCPgzy1auk58D5qy1MO/R1cW5o9RhbgXfEAjDc1bh AWlRnMyxr4K44jxMFdQUW0JLCXrAzSPOYTmDcKV9zaFD14OY1Pb9/3n8LDno2gwp Mx31b1KqQ909VBwpY97n+MfI8heCAtlF9wFjsPYlDG3sWuKyCEJSWoYKfhu/10wi RkELCP/bwUo9kxn1YRTxz8bjxW5oBa7LacqQtCAQe8xDltozPFkiODNZw/PIMsiu VHknwjz8QVMBUe/r0T1qzjv8vmslgYd+4M8K1TxTL+JFrlNVjzBEmh1Bnkm4pB2u kdfgV+YRZ6Wmdvg5JLvv4544bLNwCzdCKGAQ+qOOIjF8hFiLrqzZbbuw7h/2Utdh wcLGnjKV55pB/Gwk8X2yAMyH6M1pYufLlzmAxVF0AdpfMqaOkUQJx6Iz4D0CBwvc f1j6jOdoZl5ccASGT9oZ1k067vQfeCoFxqJEsD0UkTigUKuQx1M/jtk/tbtgf0VJ WwJIWPskUBOqeVaUPQQGDISe4hl1GCP7vmH/v2xlcaadP3cjrWl5mROnisd9X1y+ S4PjMa/Ljyg9+CMkRokgoa5DKPPHy7gCUKCg7ywdGzEXb1D1o/I= =kIOQ -----END PGP SIGNATURE----- --Y7xTucakfITjPcLV--