Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754918AbbKYIRg (ORCPT ); Wed, 25 Nov 2015 03:17:36 -0500 Received: from proxima.lp0.eu ([81.2.80.65]:42074 "EHLO proxima.lp0.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753641AbbKYIRd (ORCPT ); Wed, 25 Nov 2015 03:17:33 -0500 Subject: Re: [PATCH (v2) 7/10] watchdog: bcm63xx_wdt: Add get_timeleft function To: Guenter Roeck , linux-watchdog@vger.kernel.org References: <5650BFD6.5030700@simon.arlott.org.uk> <5650C08C.6090300@simon.arlott.org.uk> <5650E2FA.6090408@roeck-us.net> <5650E5BB.6020404@simon.arlott.org.uk> <56512937.6030903@roeck-us.net> <5651CB13.4090704@simon.arlott.org.uk> <5651CC90.7090402@simon.arlott.org.uk> <56552214.2050808@roeck-us.net> Cc: "devicetree@vger.kernel.org" , Ralf Baechle , Thomas Gleixner , Jason Cooper , Marc Zyngier , Kevin Cernekee , Florian Fainelli , Wim Van Sebroeck , Maxime Bizon , Linux Kernel Mailing List , linux-mips@linux-mips.org, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Jonas Gorski From: Simon Arlott Message-ID: <56556E84.50202@simon.arlott.org.uk> Date: Wed, 25 Nov 2015 08:17:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56552214.2050808@roeck-us.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1628 Lines: 42 On 25/11/15 02:51, Guenter Roeck wrote: > On 11/24/2015 02:15 PM, Simon Arlott wrote: >> Return the remaining time from the hardware control register. >> >> Warn when the device is registered if the hardware watchdog is currently >> running and report the remaining time left. > > This is really two logical changes, isn't it ? If you insist then I'll split it out into yet another patch. > Nice trick to figure out if the watchdog is running. > > What is the impact ? Will this result in interrupts ? Yes, if it is running it will receive interrupts and check hw->running to determine if it should stop the watchdog or not. > If so, would it make sense to _not_ reset the system after a timeout > in this case, but to keep pinging the watchdog while the watchdog device > is not open ? As the whole point of a hardware watchdog is to reset the system when there is a problem with the software, it should not be automatically reset by the driver on startup. If the watchdog is already running then it needs to be pinged by userspace before the timeout. The bootloader (CFE) doesn't leave the watchdog running. On my system I prepend some code before vmlinuz that starts it running at the maximum timeout. A module parameter could be added to automatically ping/stop it if it's running, but this should be in the watchdog core and not an individual driver. -- Simon Arlott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/