Re: [v2,1/4] watchdog: at91sam9_wdt: better watchdog support

From: Guenter Roeck
Date: Wed Oct 02 2013 - 16:42:30 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/