lkml.org 
[lkml]   [2013]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v2,1/4] watchdog: at91sam9_wdt: better watchdog support
On Wed, Oct 02, 2013 at 09:53:54PM +0200, boris brezillon wrote:
[ ... ]
> >>>>+
> >>>>+ if (!wdt->heartbeat) {
> >>>>+ dev_err(wdt->wdd.parent,
> >>>>+ ": sorry, linux timer (%i Hz) cannot handle watchdog timeout (%i ms)\n",
> >>>>+ HZ, ticks_to_ms(value));
> >>>>+ return -EINVAL;
> >>>Isn't that a bit rude ? Why not set it to the minimum ?
>
> I might have misunderstood your point.
> What is a bit rude ?
> - the fact that the minimum heartbeat timeout has to be at less or
> equal to one-forth of
> max heartbeat timeout
> - the fact that heartbeat expressed in ticks has to be more than 0
> - something else

That you don't auto-correct the heatbeat to the minimum but return -EINVAL instead.
I prefer to be user-friendly, which in this case would be to accept and handle
the <min, max> timeout values provided to the infrastructure and handle any
deviations / limitaions internally.

Or, in other words, I don't like it if the user ends up having to guess
valid parameter ranges.

Thanks,
Guenter


\
 
 \ /
  Last update: 2013-10-02 23:01    [W:0.091 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site