From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Guenter Roeck <linux@roeck-us.net>, Wim Van Sebroeck <wim@iguana.be>
Cc: <linux-watchdog@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC 3/3] watchdog: introduce CONFIG_WATCHDOG_OPEN_DEADLINE
Date: Fri, 15 Jul 2016 09:32:59 +0200 [thread overview]
Message-ID: <578891AB.3070501@prevas.dk> (raw)
In-Reply-To: <5787A4E9.30905@roeck-us.net>
On 2016-07-14 16:42, Guenter Roeck wrote:
> On 07/14/2016 02:16 AM, Rasmus Villemoes wrote:
>>
>> +config WATCHDOG_OPEN_DEADLINE
>> + bool "Allow deadline for opening watchdog device"
>> + help
>> + If a watchdog driver indicates that to the framework that
>> + the hardware watchdog is running, the framework takes care
>> + of pinging the watchdog until userspace opens
>> + /dev/watchdogN. By selecting this option, you can set a
>> + maximum time for which the kernel will do this after the
>> + device has been registered.
>> +
>> +config WATCHDOG_OPEN_TIMEOUT
>> + int "Timeout value for opening watchdog device"
>> + depends on WATCHDOG_OPEN_DEADLINE
>> + default 120000
>> + help
>> + The maximum time, in milliseconds, for which the watchdog
>> + framework takes care of pinging a watchdog device. A value
>> + of 0 means infinite. The value set here can be overridden by
>> + the commandline parameter "watchdog.open_timeout" or through
>> + sysfs.
>> +
>
> I like the basic idea, and we always thought about implementing it,
> though as "initial timeout" (I personally preferred that term).
I also used WATCHDOG_INIT_TIMEOUT in my first few drafts, and my helper
watchdog_set_open_deadline was called watchdog_set_init_timeout. But
then I stumbled on watchdog_init_timeout in watchdog_core.c, and thought
that might end up being quite confusing. I think having 'open' part of
the name is quite natural, but I don't really have strong feelings about
the naming of this thing.
> However, implementing it as configuration option diminishes its
> value substantially, since it means that using it in multi-platform
> images (such as multi_v7_defconfig) becomes impossible.
If one wants to allow this feature in an existing _defconfig, one can
set OPEN_DEADLINE=y and OPEN_TIMEOUT=0; we could change the default for
the latter to that. (I thought about just having that single config
option with a default of 0, but it wasn't much more code to allow this
thing to be compiled out completely.) Platforms without a running
watchdog won't be affected, and for those with, having a non-zero
deadline requires opt-in anyway.
> The initial timeout should be specified as module option or as
> devicetree parameter, and there should be no additional configuration
> option.
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.
Regardless of implementation, it's not something that any "distro"
kernel is going to enable (with non-zero deadline), so to use it will
require some customization - which could be a .config tweak, passing a
command line parameter, a custom dtb, and probably other options. ISTM
that the first two are the most generic and require the least repeated
work across platforms.
> Where does the module parameter in watchdog_dev.c end up ?
# cat /sys/module/watchdog/parameters/open_timeout
120000
Rasmus
next prev parent reply other threads:[~2016-07-15 7:42 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 9:16 [RFC 0/3] watchdog: introduce open deadline Rasmus Villemoes
2016-07-14 9:16 ` [RFC 1/3] watchdog: change watchdog_need_worker logic Rasmus Villemoes
2016-07-14 20:45 ` Guenter Roeck
2016-07-17 19:24 ` Wim Van Sebroeck
2016-07-17 19:49 ` Guenter Roeck
2016-07-17 20:30 ` Wim Van Sebroeck
2016-07-17 20:33 ` Wim Van Sebroeck
2016-07-14 9:16 ` [RFC 2/3] watchdog: introduce watchdog_worker_should_ping helper Rasmus Villemoes
2016-07-14 9:16 ` [RFC 3/3] watchdog: introduce CONFIG_WATCHDOG_OPEN_DEADLINE Rasmus Villemoes
2016-07-14 14:42 ` Guenter Roeck
2016-07-15 7:32 ` Rasmus Villemoes [this message]
2016-07-15 14:29 ` Guenter Roeck
2016-07-20 22:08 ` Rasmus Villemoes
2016-07-21 0:31 ` Guenter Roeck
2016-07-27 20:17 ` Rasmus Villemoes
2016-07-31 22:17 ` Guenter Roeck
2016-08-01 11:10 ` Wim Van Sebroeck
2016-12-12 9:17 ` [PATCH v2 0/2] watchdog: allow setting deadline for opening /dev/watchdogN Rasmus Villemoes
2016-12-12 9:17 ` [PATCH v2 1/2] watchdog: introduce watchdog_worker_should_ping helper Rasmus Villemoes
2016-12-12 9:17 ` [PATCH v2 2/2] watchdog: introduce CONFIG_WATCHDOG_OPEN_DEADLINE Rasmus Villemoes
2016-12-12 16:59 ` Guenter Roeck
2016-12-14 13:37 ` [PATCH v3 0/2] watchdog: allow setting deadline for opening /dev/watchdogN Rasmus Villemoes
2016-12-14 13:37 ` [PATCH v3 1/2] watchdog: introduce watchdog_worker_should_ping helper Rasmus Villemoes
2016-12-14 13:37 ` [PATCH v3 2/2] watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT Rasmus Villemoes
2017-01-02 15:22 ` Guenter Roeck
2017-01-03 15:52 ` Rasmus Villemoes
2017-01-03 18:59 ` Guenter Roeck
2017-01-02 8:04 ` [PATCH v3 0/2] watchdog: allow setting deadline for opening /dev/watchdogN Rasmus Villemoes
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=578891AB.3070501@prevas.dk \
--to=rasmus.villemoes@prevas.dk \
--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