Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2793039imm; Thu, 24 May 2018 16:19:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZryvDWvbU0RNZbB4kBOd5wl/bLvsc/ZWBtZk7jI1L99OQhIbhPnO5rGbytV0S02QfC0Nfuj X-Received: by 2002:a62:5281:: with SMTP id g123-v6mr19993pfb.22.1527203950447; Thu, 24 May 2018 16:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527203950; cv=none; d=google.com; s=arc-20160816; b=JAHT9+LcxUyYYOO76QkuDOKQ6K1DUXAVcvTjxjCdmS2/94eb2IbqFLq2LsxZPriMw3 GSWVzaUi/zRVfUHJPxBoDhB06iHz1zFchzObS1imS6cMSRrbNHfn8rgWzkdVOowb18xn GnpuPrKJnZ9Z8KQzbUd6jrIG5ojgbzoCEu5eTJvV+G3mxZ4+HNO/B01YcPMdiNiI1RoN 7x5q90bAEPOZmuNN3dbGgBHg6mAbVCHFnekCCCvYAnl92dZJGOY6frlpYzjtO4G6u1d0 45JA4JXg4K4KSOmSUhk87oXd7TchoNGCD3+b6CKvURu/GY/laFYiQidivHoEdLvPtwc8 KCiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=XyDz8mQzGrpx8cXhQYMkcT+SJPzZ7RgSENlkqUCL12I=; b=uOlJKPILnxkU0CKF2yGtUSc8n/RAz7wi/C7Ujc8mFVHARs9sXtXSGoVMjkKsaMRw1j SmJgld0n+E+/NKaTDg3g/UJliQYAimAYj4Ae7k5413uiKPlXdySfW0GQ/6Bc/bQP/9q3 FBIN/ShHbN4SzBf8GcDwsiaV6rLe9QA+Ac7HX2k2dvRIMuNcvitYETq7hILyaUCxioCJ AMZru/8RANOca65G0Dpfrf6brQR0SA4Yqm6fgjwzVXC5PhdugWrBIX21LIIDwJ0d6zZR evUkIxKpE/aGqbQQxoph6f9MDqnuTsOyXGLKJncoqISxzh/9xf8i0HKyPs63tWfuM0fb zbFg== 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 a98-v6si22063110pla.239.2018.05.24.16.18.55; Thu, 24 May 2018 16:19:10 -0700 (PDT) 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 S1754956AbeEXNZl (ORCPT + 99 others); Thu, 24 May 2018 09:25:41 -0400 Received: from foss.arm.com ([217.140.101.70]:44788 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751407AbeEXNZi (ORCPT ); Thu, 24 May 2018 09:25:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 48D351596; Thu, 24 May 2018 06:25:38 -0700 (PDT) Received: from [10.1.210.88] (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1C1073F557; Thu, 24 May 2018 06:25:35 -0700 (PDT) Subject: Re: [PATCH 1/5] Documentation: DT: Add optional 'timeout-sec' property for sp805 To: Guenter Roeck Cc: Mark Rutland , devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, Rob Herring , Ray Jui , bcm-kernel-feedback-list@broadcom.com, Wim Van Sebroeck , Frank Rowand , linux-arm-kernel@lists.infradead.org References: <1527014840-21236-1-git-send-email-ray.jui@broadcom.com> <1527014840-21236-2-git-send-email-ray.jui@broadcom.com> <20180523181058.GC27570@roeck-us.net> From: Robin Murphy Message-ID: <91d27df4-29d0-de7f-6805-c3e5f329caf3@arm.com> Date: Thu, 24 May 2018 14:25:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180523181058.GC27570@roeck-us.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/05/18 19:10, Guenter Roeck wrote: > On Wed, May 23, 2018 at 11:57:25AM +0100, Robin Murphy wrote: >> On 22/05/18 19:47, Ray Jui wrote: >>> Update the SP805 binding document to add optional 'timeout-sec' >>> devicetree property >>> >>> Signed-off-by: Ray Jui >>> Reviewed-by: Scott Branden >>> --- >>> Documentation/devicetree/bindings/watchdog/sp805-wdt.txt | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/watchdog/sp805-wdt.txt b/Documentation/devicetree/bindings/watchdog/sp805-wdt.txt >>> index edc4f0e..f898a86 100644 >>> --- a/Documentation/devicetree/bindings/watchdog/sp805-wdt.txt >>> +++ b/Documentation/devicetree/bindings/watchdog/sp805-wdt.txt >>> @@ -19,6 +19,8 @@ Required properties: >>> Optional properties: >>> - interrupts : Should specify WDT interrupt number. >>> +- timeout-sec : Should specify default WDT timeout in seconds. If unset, the >>> + default timeout is 30 seconds >> >> According to the SP805 TRM, the default interval is dependent on the rate of >> WDOGCLK, but would typically be a lot longer than that :/ >> > Depends on the definition of "default". In the context of watchdog drivers, > it is (or should be) a driver default, not a chip default. DT describes hardware, not driver behaviour. I appreciate that where a timeout *is* specified, that is effectively a hardware aspect even if it's something an OS consuming the binding still has to voluntarily program into the device. The notion of "this is the longest period of time for which you can reasonably expect to see no activity under normal operation" is indeed a property of the platform as a whole - a system with user-accessible PCIe slots may need to reflect the worst case of one CPU waiting for an ATS invalidation timeout with interrupts disabled, whereas a much shorter period might be appropriate for the same SoC in some closed-down embedded device. The absence of the property, though, doesn't convey anything other than "I don't know" and/or "it doesn't really matter", and in that situation the default is always going to be "whatever the OS thinks is appropriate". The binding itself can't possibly know, whereas an OS might be configured for some pseudo-real-time application which it knows warrants a maximum of 100ms regardless of what the DT does or doesn't say. In the case of SP805, if the OS doesn't reconfigure it at all, there happens to be an actual hardware default of (2^32 / WDOGCLK), but since that's already implicit in the compatible it doesn't really need saying either. Optional properties don't need to explicitly state what their absence might infer, especially when it's not directly meaningful (just imagine trying to do that for bindings/regulator/regulator.txt...), so I would suggest following the 93% of existing bindings which simply don't try to claim some default value for this property. I also think the fact that, within the context of this patch series, the Linux driver doesn't even do what the binding claims only goes to help make my point ;) Robin.