Re: [RFC 3/3] watchdog: introduce CONFIG_WATCHDOG_OPEN_DEADLINE

From: Rasmus Villemoes
Date: Wed Jul 20 2016 - 18:19:39 EST

On 2016-07-15 16:29, Guenter Roeck wrote:
On 07/15/2016 12:32 AM, Rasmus Villemoes wrote:

The initial timeout should be specified as module option or as
devicetree parameter, and there should be no additional configuration

I was under the impression that device tree was exclusively for
describing hardware, and this certainly is not that. I also wanted to
avoid having to modify each driver, which would seem to be necessary
if it was module parameter/DT - the only thing required of a driver
now is that it correctly reports WDOG_HW_RUNNING.

What is "hardware" ? It is supposed to describe the system, isn't it ?
Part of that system is its clock rate,
and the means how the OS is loaded, and both have impact on the initial
timeout (and the regular timeout).

You might as well argue that clock rates should not be in devicetree
either. Clock rates are, after all,
just reflecting the _use_ of the hardware, not the hardware itself.

But they are used to configure hardware. The init timeout is not a property of any particular device - it configures how the kernel behaves, and as such I find it quite natural to have it in the kernel's .config (and overridable on command line and via sysfs).

Devicetree could be handled in the core, with a function to set the
initial timeout,
or possibly even with the watchdog registration itself.

But where in the device tree would you put this value? I'd really prefer not having to modify the node representing each individual watchdog device I might use.