From: Flavio Suligoi <f.suligoi@asem.it>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Wim Van Sebroeck" <wim@linux-watchdog.org>
Subject: RE: [PATCH v1] watchdog: add new parameter to start the watchdog on module insertion
Date: Tue, 13 Apr 2021 09:09:32 +0000 [thread overview]
Message-ID: <d209130522dc4752bb4ec56c783aac4a@asem.it> (raw)
In-Reply-To: <444e0f7e-c937-49a4-d960-549e70a8390d@roeck-us.net>
Hi Guenter,
...
> >>> The new parameter "start_enabled" starts the watchdog at the same time
> >>> of the module insertion.
> >>> This feature is very useful in embedded systems, to avoid cases where
> >>> the system hangs before reaching userspace.
> >>>
> >>> This function can be also enabled in the kernel config, so can be
> >>> used when the watchdog driver is build as built-in.
> >>>
> >>> This parameter involves the "core" section of the watchdog driver;
> >>> in this way it is common for all the watchdog hardware implementations.
> >>>
> >>> Note: to use only for watchdog drivers which doesn't support this
> >>> parameter by itself.
> >>>
> >>> Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
> >>> ---
> >>> Documentation/watchdog/watchdog-parameters.rst | 5 +++++
> >>> drivers/watchdog/Kconfig | 14 ++++++++++++++
> >>> drivers/watchdog/watchdog_core.c | 12 ++++++++++++
> >>> 3 files changed, 31 insertions(+)
> >>>
> >>> diff --git a/Documentation/watchdog/watchdog-parameters.rst
> >> b/Documentation/watchdog/watchdog-parameters.rst
> >>> index 223c99361a30..623fd064df91 100644
> >>> --- a/Documentation/watchdog/watchdog-parameters.rst
> >>> +++ b/Documentation/watchdog/watchdog-parameters.rst
> >>> @@ -21,6 +21,11 @@ watchdog core:
> >>> timeout. Setting this to a non-zero value can be useful to ensure that
> >>> either userspace comes up properly, or the board gets reset and allows
> >>> fallback logic in the bootloader to try something else.
> >>> + start_enabled:
> >>> + Watchdog is started on module insertion. This option can be also
> >>> + selected by kernel config (default=kernel config parameter).
> >>> + Use only for watchdog drivers which doesn't support this parameter
> >>> + by itself.
> >>
> >> Why ?
> >
> > There are two drivers with an analogous feature (pnx833x_wdt and
> > omap_wdt) and it is important not to enable the watchdog twice.
> >
> Why ?
right, it is a nonsense ...
>
> > Ok, I can substitute the sentence: " Use only for watchdog drivers
> > which doesn't support this parameter itself." with another one, like:
> > "If the driver supports this feature by itself, be carefully not to enable
> > the watchdog twice".
> >
> > What do you think?
> >
>
> I am still missing the explanation _why_ it would be important not to enable
> a watchdog twice. Why does it matter ? What is the difference ?
>
> If there is a concern that the start function should not be called on an already
> running watchdog, the code could check for that and ensure that
> WDOG_HW_RUNNING
> is not already set before enabling it. That would probably make sense anyway.
> But adding a limitation/restriction like the above, which is not enforceable,
> is not a good idea. How would the common user know if a watchdog is already
> running (eg because it was started in BIOS/ROMMON) ?
Yes, right! I have to check WDOG_HW_RUNNING before starting the watchdog.
It is the correct way to manage this feature, in any case and for any wdog driver.
>
> Thanks,
> Guenter
Thank you very much Guenter!
Regards,
Flavio
prev parent reply other threads:[~2021-04-13 9:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 9:34 [PATCH v1] watchdog: add new parameter to start the watchdog on module insertion Flavio Suligoi
2021-04-09 15:56 ` Guenter Roeck
2021-04-12 8:29 ` Flavio Suligoi
2021-04-12 14:42 ` Guenter Roeck
2021-04-13 9:09 ` Flavio Suligoi [this message]
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=d209130522dc4752bb4ec56c783aac4a@asem.it \
--to=f.suligoi@asem.it \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mika.westerberg@linux.intel.com \
--cc=wim@linux-watchdog.org \
/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).