From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCH v4 5/7] Watchdog: introduce ARM SBSA watchdog driver Date: Tue, 09 Jun 2015 09:22:39 -0700 Message-ID: <557712CF.8010802@roeck-us.net> References: <=fu.wei@linaro.org> <1433217907-928-1-git-send-email-fu.wei@linaro.org> <1433217907-928-6-git-send-email-fu.wei@linaro.org> <556DCC95.806@codeaurora.org> <556DE2D5.3090906@roeck-us.net> <5575DE48.8010308@roeck-us.net> <55766D74.2060401@roeck-us.net> <55769E0E.8060801@roeck-us.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-doc-owner@vger.kernel.org To: Fu Wei Cc: Timur Tabi , Suravee Suthikulpanit , Linaro ACPI Mailman List , linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Wei Fu , G Gregory , Al Stone , Hanjun Guo , Ashwin Chaugule , Arnd Bergmann , vgandhi@codeaurora.org, wim@iguana.be, Jon Masters , Leo Duran , Jon Corbet , Mark Rutland , Catalin Marinas , Will Deacon , rjw@rjwysocki.net List-Id: devicetree@vger.kernel.org On 06/09/2015 03:46 AM, Fu Wei wrote: > Yes, if WOR only affect in TimeoutRefresh, we cat always make WOR == pretimeout > But the problem is if we enable watchdog (write 0x01 to WCS will > cause an explicit watchdog refresh), then > 1) if ExplicitRefresh = True: > CompareValue := SystemCounter + WOR > WS0 := True > 2) TimeoutRefresh is True again, WS0 == True: > WS1 = True > > so once we enable watchdog, system reset, that is not what we want. > this behavior is following SBSA spec. > Ok, I admit I am a bit slow ;-). WS0 := True would be set the next time around, since if ExplicitRefresh == True WS0 = False WS1 = False but I see your point. Essentially, the specification is broken for all practical purposes, since, as you point out, enabling the watchdog overwrites and explicitly sets WCV. Effectively this means that just using WCV to program the timeout period is not really possible. I am not really sure how to address this. We can either only use WOR, and forget about pretimeout, or we can enforce a minimum pretimeout. In the latter case, we'll have to write WCV after writing WOR. Thanks, Guenter