All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: <linux-watchdog@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH v3 0/2] watchdog: allow setting deadline for opening /dev/watchdogN
Date: Wed, 14 Dec 2016 14:37:32 +0100	[thread overview]
Message-ID: <1481722654-6266-1-git-send-email-rasmus.villemoes@prevas.dk> (raw)
In-Reply-To: <1481534273-7600-1-git-send-email-rasmus.villemoes@prevas.dk>

If a watchdog driver tells the framework that the device is running,
the framework takes care of feeding the watchdog until userspace opens
the device. If the userspace application which is supposed to do that
never comes up properly, the watchdog is fed indefinitely by the
kernel. This can be especially problematic for embedded devices.

These patches allow one to set a maximum time for which the kernel
will feed the watchdog, thus ensuring that either userspace has come
up, or the board gets reset. This allows fallback logic in the
bootloader to attempt some recovery (for example, if an automatic
update is in progress, it could roll back to the previous version).

The patches have been tested on a Raspberry Pi 2 (with a suitably
modified driver for setting WDOG_HW_RUNNING) and a Wandboard.

Changes since v2:

 - Use device_property_read_u32 rather than of_property_read_u32

  - Remove config option to ifdef this completely out, instead set the
    default timeout to "infinite" to preserve existing behaviour.

Changes since v1:

 - Take the timeout value from the device tree node rather than a
   watchdog module parameter.


Rasmus Villemoes (2):
  watchdog: introduce watchdog_worker_should_ping helper
  watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT

 drivers/watchdog/Kconfig         | 14 ++++++++++++++
 drivers/watchdog/watchdog_core.c | 16 ++++++++++++++++
 drivers/watchdog/watchdog_dev.c  | 27 ++++++++++++++++++++++++++-
 include/linux/watchdog.h         |  7 +++++++
 4 files changed, 63 insertions(+), 1 deletion(-)

-- 
2.7.4

  parent reply	other threads:[~2016-12-14 13:50 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
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   ` Rasmus Villemoes [this message]
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=1481722654-6266-1-git-send-email-rasmus.villemoes@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.