From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: Wim Van Sebroeck <wim@iguana.be>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
linux@roeck-us.net, linux-watchdog@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] watchdog: Add watchdog timer support for the WinSystems EBC-C384
Date: Sun, 28 Feb 2016 09:36:04 -0500 [thread overview]
Message-ID: <20160228143548.GA26320@sophia> (raw)
In-Reply-To: <20160228140739.GA7577@spo001.leaseweb.nl>
On Sun, Feb 28, 2016 at 03:07:39PM +0100, Wim Van Sebroeck wrote:
>> > +static int ebc_c384_wdt_set_timeout(struct watchdog_device *wdev, unsigned t)
>> > +{
>> > + /* resolution is in minutes for timeouts greater than 255 seconds */
>> > + if (t > 255) {
>> > + /* truncate second resolution to minute resolution */
>> > + t /= 60;
>> > + wdev->timeout = t * 60;
>> > +
>> > + /* set watchdog timer for minutes */
>> > + outb(0x00, CFG_ADDR);
>>
>> If ask for 299 seconds surely I should get 300 not 240 ?
>> (Whether to round off or round up is an interesting question for the
>> middle range - does it go off early or late - I'd have said late but...)
>
>This is my preference:
> if (t > 255)
> t = (((t - 1) / 60) + 1) * 60;
>
>Which basically is a round-up to minutes
>t = 256 -> gives 300
>t = 299 -> gives 300
>t = 300 -> gives 300
>t = 301 -> gives 360
>t = 15299 -> gives 15300
>t = 15300 -> gives 15300
>t = 15301 -> gives 15360
>
>So I am also for going late.
>
>Kind regards,
>Wim.
I decided to give this another consideration: perhaps we should allow it
to go late rather than early. I figure that when a user configures the
watchdog timer for a certain value in seconds they will have an
expectation that the watchdog timer will wait at least that amount of
time (with the understanding that it may be somewhat late due to the
granularity of the timer).
This behavior follows a lot of other timer standards (e.g. nanosleep)
so it's what the user expects and what we should follow for now. I'll
submit a version 5 patch with this change.
William Breathitt Gray
next prev parent reply other threads:[~2016-02-28 14:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 19:09 [PATCH v3] watchdog: Add watchdog timer support for the WinSystems EBC-C384 William Breathitt Gray
2016-01-25 19:28 ` One Thousand Gnomes
2016-01-25 20:42 ` Guenter Roeck
2016-01-25 23:36 ` William Breathitt Gray
2016-01-26 1:26 ` Guenter Roeck
2016-01-26 23:38 ` William Breathitt Gray
2016-01-27 5:02 ` Guenter Roeck
2016-01-28 0:18 ` William Breathitt Gray
2016-01-28 1:51 ` Guenter Roeck
2016-01-28 11:05 ` One Thousand Gnomes
2016-01-26 1:58 ` Guenter Roeck
2016-02-28 14:07 ` Wim Van Sebroeck
2016-02-28 14:36 ` William Breathitt Gray [this message]
2016-02-28 15:02 ` Guenter Roeck
2016-02-28 16:24 ` Wim Van Sebroeck
2016-01-26 1:11 ` Guenter Roeck
2016-01-26 9:09 ` Paul Bolle
2016-01-26 12:33 ` William Breathitt Gray
-- strict thread matches above, loose matches on Subject: below --
2016-01-26 14:31 William Breathitt Gray
2016-01-26 15:30 ` Guenter Roeck
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=20160228143548.GA26320@sophia \
--to=vilhelm.gray@gmail.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--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;
as well as URLs for NNTP newsgroup(s).