[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1465321127-19522-1-git-send-email-vladimir_zapolskiy@mentor.com>
Date: Tue, 7 Jun 2016 20:38:41 +0300
From: Vladimir Zapolskiy <vladimir_zapolskiy@...tor.com>
To: Wim Van Sebroeck <wim@...ana.be>,
Guenter Roeck <linux@...ck-us.net>
CC: Wolfram Sang <wsa@...-dreams.de>,
Robin Gong <b38343@...escale.com>,
<linux-watchdog@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v3 0/6] watchdog: add watchdog pretimeout framework
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
Powered by blists - more mailing lists