linux/Documentation/watchdog
Guenter Roeck b4ffb19098 watchdog: Separate and maintain variables based on variable lifetime
All variables required by the watchdog core to manage a watchdog are
currently stored in struct watchdog_device. The lifetime of those
variables is determined by the watchdog driver. However, the lifetime
of variables used by the watchdog core differs from the lifetime of
struct watchdog_device. To remedy this situation, watchdog drivers
can implement ref and unref callbacks, to be used by the watchdog
core to lock struct watchdog_device in memory.

While this solves the immediate problem, it depends on watchdog drivers
to actually implement the ref/unref callbacks. This is error prone,
often not implemented in the first place, or not implemented correctly.

To solve the problem without requiring driver support, split the variables
in struct watchdog_device into two data structures - one for variables
associated with the watchdog driver, one for variables associated with
the watchdog core. With this approach, the watchdog core can keep track
of its variable lifetime and no longer depends on ref/unref callbacks
in the driver. As a side effect, some of the variables originally in
struct watchdog_driver are now private to the watchdog core and no longer
visible in watchdog drivers.

As a side effect of the changes made, an ioctl will now always fail
with -ENODEV after a watchdog device was unregistered with the character
device still open. Previously, it would only fail with -ENODEV in some
situations. Also, ioctl operations are now atomic from driver perspective.
With this change, it is now guaranteed that the driver will not unregister
a watchdog between a timeout change and the subsequent ping.

The 'ref' and 'unref' callbacks in struct watchdog_driver are no longer
used and marked as deprecated.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-12-29 20:36:03 +01:00
..
src Documentation/watchdog: add timeout and ping rate control to watchdog-test.c 2015-09-09 21:33:36 +02:00
convert_drivers_to_kernel_api.txt watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core 2012-03-27 20:15:37 +02:00
hpwdt.txt Fix common misspellings 2011-03-31 11:26:23 -03:00
Makefile Documentation: use subdir-y to avoid unnecessary built-in.o files 2014-09-26 11:02:55 +02:00
pcwd-watchdog.txt [WATCHDOG] clean-up watchdog documentation 2007-05-24 17:26:11 +00:00
watchdog-api.txt Documentation: fix two typos in watchdog-api.txt 2014-08-05 22:43:21 +02:00
watchdog-kernel-api.txt watchdog: Separate and maintain variables based on variable lifetime 2015-12-29 20:36:03 +01:00
watchdog-parameters.txt watchdog: omap_wdt: early_enable module parameter 2015-07-01 16:43:17 +02:00
wdt.txt watchdog: update/improve/consolidate watchdog driver 2010-05-25 09:05:34 +00:00