From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5416E820.3070305@roeck-us.net> Date: Mon, 15 Sep 2014 06:22:40 -0700 From: Guenter Roeck MIME-Version: 1.0 To: Sergey Ryazanov CC: Ralf Baechle , Linux MIPS , Wim Van Sebroeck , linux-watchdog@vger.kernel.org Subject: Re: [RFC 13/18] watchdog: add Atheros AR2315 watchdog driver References: <1410723213-22440-1-git-send-email-ryazanov.s.a@gmail.com> <1410723213-22440-14-git-send-email-ryazanov.s.a@gmail.com> <541656A3.8030906@roeck-us.net> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-Path: Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: List-Archive: List-Post: List-ID: On 09/15/2014 02:42 AM, Sergey Ryazanov wrote: > 2014-09-15 7:01 GMT+04:00, Guenter Roeck : >> On 09/14/2014 12:33 PM, Sergey Ryazanov wrote: >>> Signed-off-by: Sergey Ryazanov >>> Cc: Wim Van Sebroeck >>> Cc: linux-watchdog@vger.kernel.org >>> --- >>> arch/mips/ar231x/ar2315.c | 26 +++++- >>> drivers/watchdog/Kconfig | 7 ++ >>> drivers/watchdog/Makefile | 1 + >>> drivers/watchdog/ar2315-wtd.c | 202 >>> ++++++++++++++++++++++++++++++++++++++++++ >> >> This should be two patches: One to instantiate the watchdog, >> the second the watchdog driver itself. The weatchdog driver >> should use the watchdog infrastructure. >> > Ok. Will do in v2. > > [skipped] > >>> + * >>> + * Copyright (C) 2008 John Crispin >>> + * Based on EP93xx and ifxmips wdt driver >> >> 2008 ? >> > Yes. This driver is pretty old. > > [skipped] > >>> + >>> +#define CLOCK_RATE 40000000 >>> +#define HEARTBEAT(x) (x < 1 || x > 90 ? 20 : x) >>> + >> Whatever the logic is here, it does not make much sense to me. >> > 90 second is maximal value which we could write to register, and value > below 1 second is senseless. So this macros always return a value > which make sense: specified by user or default. > I would agree that the value generates would be clamped, for example by using the clamp_val macro. Bit your logic is such that the user gets a timeout of 90 seconds when specifying 90 seconds, and 20 seconds when specifying 91 seconds. Doesn't really matter much if you use the watchdog framework, as it takes care of range checking. Guenter