From: Guenter Roeck <linux@roeck-us.net>
To: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
Linux MIPS <linux-mips@linux-mips.org>,
Wim Van Sebroeck <wim@iguana.be>,
linux-watchdog@vger.kernel.org
Subject: Re: [RFC 13/18] watchdog: add Atheros AR2315 watchdog driver
Date: Mon, 15 Sep 2014 06:22:40 -0700 [thread overview]
Message-ID: <5416E820.3070305@roeck-us.net> (raw)
In-Reply-To: <CAHNKnsT5AHT9xaaY44yTo7uMiOGL9fekGkEzjQuYvdUyJs-WQA@mail.gmail.com>
On 09/15/2014 02:42 AM, Sergey Ryazanov wrote:
> 2014-09-15 7:01 GMT+04:00, Guenter Roeck <linux@roeck-us.net>:
>> On 09/14/2014 12:33 PM, Sergey Ryazanov wrote:
>>> Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
>>> Cc: Wim Van Sebroeck <wim@iguana.be>
>>> 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 <blogic@openwrt.org>
>>> + * 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
prev parent reply other threads:[~2014-09-15 13:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1410723213-22440-1-git-send-email-ryazanov.s.a@gmail.com>
2014-09-14 19:33 ` [RFC 13/18] watchdog: add Atheros AR2315 watchdog driver Sergey Ryazanov
2014-09-15 3:01 ` Guenter Roeck
2014-09-15 9:42 ` Sergey Ryazanov
2014-09-15 13:22 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5416E820.3070305@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-mips@linux-mips.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=ryazanov.s.a@gmail.com \
--cc=wim@iguana.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox