linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] watchdog: add watchdog pretimeout framework
@ 2016-06-07 17:38 Vladimir Zapolskiy
  2016-06-07 17:38 ` [PATCH v3 1/6] watchdog: add set_pretimeout interface Vladimir Zapolskiy
                   ` (7 more replies)
  0 siblings, 8 replies; 35+ messages in thread
From: Vladimir Zapolskiy @ 2016-06-07 17:38 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: Wolfram Sang, Robin Gong, linux-watchdog, linux-kernel

The change adds a simple watchdog pretimeout framework infrastructure,
its purpose is to allow users to select a desired handling of watchdog
pretimeout events, which may be generated by a watchdog driver.

The idea of adding this kind of a framework appeared after reviewing
several attempts to add hardcoded pretimeout event handling to some
watchdog driver and after a discussion with Guenter, see
https://lkml.org/lkml/2015/11/4/346

Watchdogs with WDIOF_PRETIMEOUT capability now have two device
attributes in sysfs: read/write pretimeout_governor attribute and read
only pretimeout_available_governors attribute.

To throw a pretimeout event for further processing a watchdog driver
should call exported  watchdog_notify_pretimeout(wdd) interface.

In addition to the framework a number of simple watchdog pretimeout
governors are added for review: panic and noop.

Hopefully the change opens a possibility to complete development of
device specific watchdog pretimeout bits.

In comparison to v1 and v2 this version does not have quite many important
features, because now the goal is to initiate technical review of the
simplest possible core change, the fat tail is put aside at the moment.

These missing features from v1 and v2 are done, they'll be published
on top of the series after technical review completion of the core:
* compilation of several independent watchdog pretimeout governors
* watchdog pretimeout governors may be compiled as built-in or modules
* governors individually selectable per watchdog device over sysfs
* able to sleep watchdog pretimeout governors
* userspace notification over uevent governor

Note that the currently omitted design features of the watchdog pretimeout
framework are similar to cpufreq, devfreq and thermal governors, this
includes:
* option to compile governors as kernel modules,
* compile time selection of a default governor,
* similar per-device sysfs attributes and one governor to one device
  link model.

Changes from v2 to v3:
* from watchdog_pretimeout.c removed all features mentioned above
* rebased panic and noop governors on top of the simplified watchdog pretimeout
  framework
* added 2 rebased and cleaned up changes done by Robin Gong to the series,
  Robin's changes allow to test the series, if some individual watchdog driver
  adds WDIOF_PRETIMEOUT support and calls watchdog_notify_pretimeout(),
  for example Robin implemented the feature for imx2+ watchdog driver
* added pretimeout value display over sysfs for WDIOF_PRETIMEOUT capable
  watchdog devices
* moved sysfs device attributes to watchdog_dev.c, this required to add
  exported watchdog_pretimeout_governor_name() interface
* if pretimeout framework is not selected, then pretimeout event ends up
  in kernel panic -- this behaviour as a default one was asked by Guenter
* due to removal of support to sleeing governors removed userspace
  notification pretimeout governor from the series
* minor clean-ups and adjustments

Changes from v1 to v2, thanks to Guenter for review and discussion:
* removed re-ping pretimeout governor, the functionality is supposed
  to be covered by the pending infrastructure enhancements,
* removed watchdog driver specific pretimeout governor, at the moment
  it is not expected to add driver specific handlers,
* reordered governors, panic comes in the first place,
* removed framework private bits from struct watchdog_governor,
* centralized compile-time selection of a default governor in
  watchdog_pretimeout.h,
* added can_sleep option, now only sleeping governors (e.g. userspace)
  will be executed in a special workqueue,
* changed fallback logic, if a governor in use is removed, now this
  situation is not possible, because in use governors have non-zero
  module refcount,
* slightly improved description of the governors in Kconfig.

Robin Gong (2):
  watchdog: add set_pretimeout interface
  watchdog: add WDIOC_SETPRETIMEOUT and WDIOC_GETPRETIMEOUT

Vladimir Zapolskiy (4):
  watchdog: add pretimeout read-only device attribute to sysfs
  watchdog: add watchdog pretimeout framework
  watchdog: pretimeout: add panic pretimeout governor
  watchdog: pretimeout: add noop pretimeout governor

 drivers/watchdog/Kconfig               |  44 +++++++++++
 drivers/watchdog/Makefile              |   8 +-
 drivers/watchdog/pretimeout_noop.c     |  47 ++++++++++++
 drivers/watchdog/pretimeout_panic.c    |  47 ++++++++++++
 drivers/watchdog/watchdog_core.c       |   9 +++
 drivers/watchdog/watchdog_dev.c        |  60 +++++++++++++++
 drivers/watchdog/watchdog_pretimeout.c | 134 +++++++++++++++++++++++++++++++++
 drivers/watchdog/watchdog_pretimeout.h |  48 ++++++++++++
 include/linux/watchdog.h               |  23 ++++++
 9 files changed, 419 insertions(+), 1 deletion(-)
 create mode 100644 drivers/watchdog/pretimeout_noop.c
 create mode 100644 drivers/watchdog/pretimeout_panic.c
 create mode 100644 drivers/watchdog/watchdog_pretimeout.c
 create mode 100644 drivers/watchdog/watchdog_pretimeout.h

-- 
2.5.0

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2016-06-24 22:13 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 17:38 [PATCH v3 0/6] watchdog: add watchdog pretimeout framework Vladimir Zapolskiy
2016-06-07 17:38 ` [PATCH v3 1/6] watchdog: add set_pretimeout interface Vladimir Zapolskiy
2016-06-07 20:32   ` Guenter Roeck
2016-06-08  6:34   ` Wolfram Sang
2016-06-08 12:58     ` Vladimir Zapolskiy
2016-06-09 21:12       ` Wolfram Sang
2016-06-07 17:38 ` [PATCH v3 2/6] watchdog: add WDIOC_SETPRETIMEOUT and WDIOC_GETPRETIMEOUT Vladimir Zapolskiy
2016-06-07 17:38 ` [PATCH v3 3/6] watchdog: add pretimeout read-only device attribute to sysfs Vladimir Zapolskiy
2016-06-08  6:57   ` Wolfram Sang
2016-06-07 17:38 ` [PATCH v3 4/6] watchdog: add watchdog pretimeout framework Vladimir Zapolskiy
2016-06-07 21:43   ` Guenter Roeck
2016-06-08 13:37     ` Vladimir Zapolskiy
2016-06-08 13:53       ` Guenter Roeck
2016-06-08 15:11         ` Vladimir Zapolskiy
2016-06-08 15:38           ` kbuild: default n removals? (was: Re: [PATCH v3 4/6] watchdog: add watchdog pretimeout framework) Joe Perches
2016-06-08 18:05             ` Guenter Roeck
2016-06-15 10:02             ` kbuild: default n removals? Michal Marek
2016-06-08  6:54   ` [PATCH v3 4/6] watchdog: add watchdog pretimeout framework Wolfram Sang
2016-06-08 14:08     ` Vladimir Zapolskiy
2016-06-08 18:20       ` Guenter Roeck
2016-06-09 21:22         ` Wolfram Sang
2016-06-09 21:14       ` Wolfram Sang
2016-06-07 17:38 ` [PATCH v3 5/6] watchdog: pretimeout: add panic pretimeout governor Vladimir Zapolskiy
2016-06-08  7:08   ` Wolfram Sang
2016-06-08 14:28     ` Vladimir Zapolskiy
2016-06-09 21:23       ` Wolfram Sang
2016-06-07 17:38 ` [PATCH v3 6/6] watchdog: pretimeout: add noop " Vladimir Zapolskiy
2016-06-08  7:10   ` Wolfram Sang
2016-06-08 14:32     ` Vladimir Zapolskiy
2016-06-08  7:56 ` [PATCH v3 0/6] watchdog: add watchdog pretimeout framework Wolfram Sang
2016-06-08 15:35   ` Vladimir Zapolskiy
2016-06-09 21:30     ` Wolfram Sang
2016-06-24  9:46 ` Wolfram Sang
2016-06-24 13:45   ` Guenter Roeck
2016-06-24 22:13     ` Vladimir Zapolskiy

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).