Received: by 10.223.176.5 with SMTP id f5csp1206139wra; Fri, 9 Feb 2018 14:41:23 -0800 (PST) X-Google-Smtp-Source: AH8x226RyMZLmxC4g+2KMdN4HzucmREuyWQdXhqnaJaqEEJm+VY/g7IncS/jtGurUN98J2X7VXgE X-Received: by 10.101.98.2 with SMTP id d2mr3563967pgv.275.1518216083051; Fri, 09 Feb 2018 14:41:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518216083; cv=none; d=google.com; s=arc-20160816; b=AcrrClfKaueLmOERmDc1u5u6PvJkLh74NELAG4bykRXPwo+5Aad0KHs3jnfO5T9Mto /M1SJLsdjVBsbM7CHWK57km/d1SYTxOlw0at+q0Q1GVqy4xtQew/DtKDOXC/kYF1hEh+ +Cvses/ecmYMCFixUb6USgYqIH3UVNGKe/3VGOEwvgBW9ffOj3ZzT2MIRXoeUAOwfh62 9OSpTUUl5LrkS4hiAkMqMKYcyaDx/OfFbgh0+5CQVxcGXKpZuAm+dt8Ci80LTQ/4J/s6 ULssfVc8fRwmO/u/ob9Bvr172LUsOyZEImOJUu7elQ8rHccm7oboqwCzrisxzefelOtg angw== 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=mvPR8Qdx9QWkJp6Ey6uy66HoHdGOPZAiiXumF2UkMt8=; b=r7XVd4pTdvbAUr72o1V2dcaMpmnvVhIQN9VoZUhyZxUghkIjX4R+3hyuYXm4qNvA3o 22ONw6kuScCxQ5Mau5s/FNJr0/Xw36hi+K3gqRUReNnaQcBcNoLgqj3J+mnpPYKG754E XE32g/N4lFu3JLAJ3H+op3xzbx2mKbvc/g7OrtR97A91dbbqwmZRa25eQCHhaE+b6ckI 1bnUl1BgNIpdfAX4hDC76FrsidmMw/EvGGw4A3r4/WtbQCrwF9XVoslq233lm4Mgo5+Y e9y38j6aRJf+Yppj5ls83HVqlaagMXSqOrzNrYmO/cuAdiNdMvpx0cnDjVt0gHFnjugc epvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GlR0m7tK; 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 f192si20323pgc.27.2018.02.09.14.41.09; Fri, 09 Feb 2018 14:41:23 -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=fail header.i=@gmail.com header.s=20161025 header.b=GlR0m7tK; 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 S1753168AbeBIWjI (ORCPT + 99 others); Fri, 9 Feb 2018 17:39:08 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:44033 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753028AbeBIWjG (ORCPT ); Fri, 9 Feb 2018 17:39:06 -0500 Received: by mail-pl0-f66.google.com with SMTP id f8so2099811plk.11; Fri, 09 Feb 2018 14:39:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mvPR8Qdx9QWkJp6Ey6uy66HoHdGOPZAiiXumF2UkMt8=; b=GlR0m7tKrDd+zL4gavFLx30Hfgt7ItITcLeAMuAFr3wkMPQ/FPzrExuLYRr07Z/Th1 lZEJF9u/QXXYNmJAMW1oJcziHJMNnLaq/mfwsAxH5zxGDJ9i1E0zHQ1hEc60viCg/AeZ AqLKUd6IRc8FOc+ccMi3NjYA87i8Bel0ACogphDMUJRXY4Vq/RnZ8lyHXGw1/n6PGi9V 9Rj8JWm9q54PIdlW361j3/NscIm8/EuiOGeMHBrHmhCW1iChXP9oWZpXrfr4yi3HTvdI rVqAqIe8slGtKqMUds/rZ4qOGYE/8/KxuVoZLG3C+FrWVI2HFhHyLX8iC88xR1temu1N d8Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=mvPR8Qdx9QWkJp6Ey6uy66HoHdGOPZAiiXumF2UkMt8=; b=NoPcK8dDAlf1ynkHvsg/JHG2UUDSuh9ks863M414LeWBaXjnRAhbOmSvXFzagqbELf DcW7fCQxtpzYe2IGHb4Mxb0CjC+HyN+aUhE5ASbzaAtqN1mqgoH5UStXQzGzlISmX8Kk q1ok5Djqg8pyTBdBZcS8O998da3Bb2/7BebFTiK6pZeM9qoH5w8NAo25OeDMYToLktiV EG18lzzK38sXmpudr4RzbeSd8fNz7+zRDgtcNwF0uo1rmmfuDMtv/GB0zMbfu0vBa83q P94F5L8oQ/f5/Q1nVO/HkRGAFSoRaRglEyjK4+nVIoKh9uCaBgzt0NnDv/rWlowsEh0g IWNg== X-Gm-Message-State: APf1xPDv7rYGrFQDwJb1uZhFekH7f4dp8Yl1c5Gs0qJg/zfE663lVzDK OmryKrylSEUPjF299/Ran5E= X-Received: by 2002:a17:902:e81:: with SMTP id 1-v6mr3992412plx.169.1518215945986; Fri, 09 Feb 2018 14:39:05 -0800 (PST) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id w2sm6486181pgm.59.2018.02.09.14.39.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 14:39:05 -0800 (PST) Date: Fri, 9 Feb 2018 14:39:04 -0800 From: Guenter Roeck To: Marcus Folkesson Cc: Wim Van Sebroeck , 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 , linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 2/7] watchdog: sunxi: allow setting timeout in devicetree Message-ID: <20180209223904.GC19627@roeck-us.net> References: <20180209192724.1227-1-marcus.folkesson@gmail.com> <20180209192724.1227-3-marcus.folkesson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180209192724.1227-3-marcus.folkesson@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 09, 2018 at 08:27:19PM +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/sunxi-wdt.txt | 4 ++++ > drivers/watchdog/sunxi_wdt.c | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt > index 62dd5baad70e..49900e72f6b1 100644 > --- a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt > +++ b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt > @@ -6,9 +6,13 @@ Required properties: > "allwinner,sun6i-a31-wdt" > - reg : Specifies base physical address and size of the registers. > > +Optional properties: > +- timeout-sec : Contains the watchdog timeout in seconds > + > Example: > > wdt: watchdog@1c20c90 { > compatible = "allwinner,sun4i-a10-wdt"; > reg = <0x01c20c90 0x10>; > + timeout-sec = <10>; > }; > diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c > index 9728fa32c357..55f166bec0ca 100644 > --- a/drivers/watchdog/sunxi_wdt.c > +++ b/drivers/watchdog/sunxi_wdt.c > @@ -39,7 +39,7 @@ > #define DRV_VERSION "1.0" > > static bool nowayout = WATCHDOG_NOWAYOUT; > -static unsigned int timeout = WDT_MAX_TIMEOUT; > +static unsigned int timeout; > > /* > * This structure stores the register offsets for different variants > -- > 2.15.1 >