linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/7] watchdog: add watchdog pretimeout framework
@ 2016-08-26 16:07 Vladimir Zapolskiy
  2016-08-26 16:07 ` [PATCH v4 1/7] watchdog: add pretimeout support to the core Vladimir Zapolskiy
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Vladimir Zapolskiy @ 2016-08-26 16:07 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Wolfram Sang; +Cc: linux-watchdog

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 may have three device
attributes in sysfs: read only pretimeout value attribute, read/write
pretimeout_governor attribute, 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 two simple watchdog pretimeout governors
are added for review: panic and noop.

Link to v3 change and discussion: https://lkml.org/lkml/2016/6/7/804

Changes from v3 to v4 :
* took Wolfram's more advanced flavour of "watchdog: add
  set_pretimeout interface" change, which is based on originally
  written by Robin Gong code (Wolfram)
* documented new watchdog_notify_pretimeout() function for developers
  of watchdog device drivers (Guenter)
* reordered logical operations in wdt_is_visible() for better clarity (Guenter)
* if watchdog pretimeout governor is not registered return empty
  string on reading "pretimeout_governor" device attribute, however with
  the default governor built-in this should never happen on practice (Guenter)
* removed a number of sanity checks from functions which are assumed
  to be exported, callers are expected to write correct code, also this
  fixes one bug in watchdog_register_governor() noticed by Guenter (Guenter)
* reworded some commit messages (Guenter)
* moved registration of watchdog pretimeout event by from watchdog_core.c to
  watchdog_dev.c (Wolfram)
* from the series removed support of potentially sleeping governors (Wolfram)
* removed "panic panic" duplication in a user's message (Wolfram)
* report watchdog name in a message given by noop governor (Wolfram)
* exploiting the fact that there is only one default governor selected
  at build time allows to remove .is_default from "struct governor_priv"
  and find_default_governor() helper function, this is a change against
  complete version v2
* by unloading some assigned non-default governor a watchdog device
  falls back to default governor, this allows to avoid complicated
  module locking scheme by module owners, this is a change against
  completeversion v2
* to avoid spreading of watchdog device "struct device" operations
  while adding device attributes by watchdog_pretimeout_governor_[gs]et()
  and watchdog_pretimeout_available_governors_get() functions called
  from watchdog_dev.c, this is a change against complete version v2
* split the main change into 3 to hopefully enlighten review process:
  1) default governor support only, 2) selectable by a user governor in
  runtime, 3) added pretimeout_available_governors attribute
* fixed a list element deregistration bug

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.

Vladimir Zapolskiy (5):
  watchdog: add watchdog pretimeout governor framework
  watchdog: pretimeout: add panic pretimeout governor
  watchdog: pretimeout: add noop pretimeout governor
  watchdog: pretimeout: add option to select a pretimeout governor in runtime
  watchdog: pretimeout: add pretimeout_available_governors attribute

Wolfram Sang (2):
  watchdog: add pretimeout support to the core
  fs: compat_ioctl: add pretimeout functions for watchdogs

 Documentation/watchdog/watchdog-kernel-api.txt |  32 ++++
 drivers/watchdog/Kconfig                       |  49 ++++++
 drivers/watchdog/Makefile                      |   8 +-
 drivers/watchdog/pretimeout_noop.c             |  47 ++++++
 drivers/watchdog/pretimeout_panic.c            |  47 ++++++
 drivers/watchdog/watchdog_dev.c                | 101 +++++++++++-
 drivers/watchdog/watchdog_pretimeout.c         | 220 +++++++++++++++++++++++++
 drivers/watchdog/watchdog_pretimeout.h         |  60 +++++++
 fs/compat_ioctl.c                              |   2 +
 include/linux/watchdog.h                       |  24 +++
 10 files changed, 587 insertions(+), 3 deletions(-)
 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.8.1

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

end of thread, other threads:[~2016-08-29 20:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-26 16:07 [PATCH v4 0/7] watchdog: add watchdog pretimeout framework Vladimir Zapolskiy
2016-08-26 16:07 ` [PATCH v4 1/7] watchdog: add pretimeout support to the core Vladimir Zapolskiy
2016-08-29 18:50   ` Wolfram Sang
2016-08-29 19:58     ` Vladimir Zapolskiy
2016-08-29 20:30       ` Guenter Roeck
2016-08-26 16:07 ` [PATCH v4 2/7] fs: compat_ioctl: add pretimeout functions for watchdogs Vladimir Zapolskiy
2016-08-26 16:07 ` [PATCH v4 3/7] watchdog: add watchdog pretimeout governor framework Vladimir Zapolskiy
2016-08-26 16:07 ` [PATCH v4 4/7] watchdog: pretimeout: add panic pretimeout governor Vladimir Zapolskiy
2016-08-29 18:48   ` Wolfram Sang
2016-08-29 19:57     ` Vladimir Zapolskiy
2016-08-26 16:07 ` [PATCH v4 5/7] watchdog: pretimeout: add noop " Vladimir Zapolskiy
2016-08-29 18:49   ` Wolfram Sang
2016-08-26 16:08 ` [PATCH v4 6/7] watchdog: pretimeout: add option to select a pretimeout governor in runtime Vladimir Zapolskiy
2016-08-29 18:54   ` Wolfram Sang
2016-08-29 19:56     ` Vladimir Zapolskiy
2016-08-26 16:08 ` [PATCH v4 7/7] watchdog: pretimeout: add pretimeout_available_governors attribute 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).