linux-stable/drivers/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
..
acquirewdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
advantechwdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
alim1535_wdt.c
alim7101_wdt.c watchdog: alim7101: register restart handler with kernel restart handler 2014-09-26 00:00:32 -07:00
ar7_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
asm9260_wdt.c watchdog: add Alphascale asm9260-wdt driver 2015-12-28 22:47:46 +01:00
at32ap700x_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
at91rm9200_wdt.c Merge git://www.linux-watchdog.org/linux-watchdog 2015-09-11 15:12:59 -07:00
at91sam9_wdt.c watchdog: at91sam9: get and use slow clock 2015-09-09 21:38:52 +02:00
at91sam9_wdt.h watchdog: add a driver to support SAMA5D4 watchdog timer 2015-09-09 21:38:29 +02:00
ath79_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
atlas7_wdt.c watchdog: atlas7: add watchdog driver of CSRatlas7 2015-12-28 22:09:50 +01:00
bcm47xx_wdt.c watchdog: bcm47xx_wdt: use core reboot notifier 2015-12-13 15:55:55 +01:00
bcm63xx_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
bcm2835_wdt.c watchdog: bcm2835_wdt: Drop log message if watchdog is stopped 2015-12-28 23:04:04 +01:00
bcm7038_wdt.c watchdog: Watchdog driver for Broadcom Set-Top Box 2015-10-27 16:12:02 +01:00
bcm_kona_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
bfin_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
booke_wdt.c watchdog: booke_wdt: Use infrastructure to check timeout limits 2015-09-09 21:34:34 +02:00
cadence_wdt.c watchdog: cadence_wdt: use to_platform_device() 2015-12-27 21:15:34 +01:00
coh901327_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
cpu5wdt.c
cpwd.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
da9052_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
da9055_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
da9062_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
da9063_wdt.c watchdog: da9063_wdt: use core restart handler 2015-12-13 15:29:24 +01:00
davinci_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
diag288_wdt.c watchdog: diag288: Stop re-using watchdog core internal flags 2015-12-29 20:36:02 +01:00
digicolor_wdt.c watchdog: digicolor_wdt: use core restart handler 2015-12-13 15:29:27 +01:00
dw_wdt.c watchdog: dw_wdt: fix signedness bug in dw_wdt_top_in_seconds() 2015-12-27 21:04:50 +01:00
ep93xx_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
eurotechwdt.c
f71808e_wdt.c
gef_wdt.c watchdog: Fix module autoload for OF platform driver 2015-09-28 10:56:01 +02:00
geodewdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
gpio_wdt.c watchdog: gpio: Do not use device pointer from struct watchdog_device 2015-12-28 23:04:05 +01:00
hpwdt.c watchdog: hpwdt: HP rebranding 2015-12-28 22:09:12 +01:00
i6300esb.c
ib700wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
ibmasr.c
ie6xx_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
imgpdc_wdt.c watchdog: imgpdc_wdt: use core restart handler 2015-12-13 15:29:30 +01:00
imx2_wdt.c watchdog: imx2_wdt: use core restart handler 2015-12-13 15:29:33 +01:00
indydog.c
intel-mid_wdt.c watchdog: intel-mid: add Magic Closure flag 2015-10-28 22:58:32 +01:00
intel_scu_watchdog.c
intel_scu_watchdog.h
iop_wdt.c
it87_wdt.c watchdog: it87_wdt: add IT8783 ID 2015-02-17 21:32:08 +01:00
it8712f_wdt.c
iTCO_vendor.h
iTCO_vendor_support.c
iTCO_wdt.c watchdog: iTCO_wdt: Add support for TCO on Intel Sunrisepoint 2015-08-11 15:03:52 +01:00
ixp4xx_wdt.c
jz4740_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
Kconfig watchdog: add support for Sigma Designs SMP86xx/SMP87xx 2015-12-28 23:03:50 +01:00
kempld_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
ks8695_wdt.c char: make misc_deregister a void function 2015-08-05 10:35:49 -07:00
lantiq_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
lpc18xx_wdt.c watchdog: lpc18xx_wdt: use core restart handler 2015-12-13 15:29:36 +01:00
m54xx_wdt.c
machzwd.c
Makefile watchdog: add support for Sigma Designs SMP86xx/SMP87xx 2015-12-28 23:03:50 +01:00
max63xx_wdt.c watchdog: max63xx: dynamically allocate device 2015-06-29 11:50:53 +02:00
mena21_wdt.c watchdog: mena21: Do not use device pointer from struct watchdog_device 2015-12-28 23:04:06 +01:00
menf21bmc_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
meson_wdt.c watchdog: meson: Add meson8b SoC specific data 2015-12-28 22:09:39 +01:00
mixcomwd.c
moxart_wdt.c watchdog: moxart_wdt: use core restart handler 2015-12-13 15:29:46 +01:00
mpc8xxx_wdt.c watchdog: mpc8xxx: use better error code when watchdog cannot be enabled 2015-09-09 21:37:51 +02:00
mtk_wdt.c watchdog: mtk_wdt: use core restart handler 2015-12-13 15:29:51 +01:00
mtx-1_wdt.c
mv64x60_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
nuc900_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
nv_tco.c watchdog: (nv_tco) add support for MCP79 2015-09-09 21:34:24 +02:00
nv_tco.h
octeon-wdt-main.c watchdog: octeon: use fixed length string for register names 2015-04-22 15:28:40 +02:00
octeon-wdt-nmi.S
of_xilinx_wdt.c watchdog: xilinx: Remove .owner field for driver 2014-10-20 20:43:42 +02:00
omap_wdt.c watchdog: omap: don't disable the timer when it should be enabled early 2015-12-27 21:09:40 +01:00
omap_wdt.h watchdog: omap_wdt: implement get_timeleft 2015-06-22 15:54:35 +02:00
orion_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
pc87413_wdt.c
pcwd.c
pcwd_pci.c
pcwd_usb.c
pika_wdt.c
pnx833x_wdt.c
pnx4008_wdt.c watchdog: pnx4008: make global wdt_clk static 2015-11-23 08:59:07 +01:00
qcom-wdt.c watchdog: qcom-wdt: Do not set 'dev' in struct watchdog_device 2015-12-28 23:04:08 +01:00
rc32434_wdt.c
rdc321x_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
retu_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
riowd.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
rn5t618_wdt.c watchdog: add driver for Ricoh RN5T618 watchdog 2014-10-20 20:55:02 +02:00
rt2880_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
s3c2410_wdt.c watchdog: s3c2410_wdt: use core restart handler 2015-12-13 15:29:57 +01:00
sa1100_wdt.c
sama5d4_wdt.c watchdog: add a driver to support SAMA5D4 watchdog timer 2015-09-09 21:38:29 +02:00
sb_wdog.c
sbc60xxwdt.c
sbc7240_wdt.c
sbc8360.c
sbc_epx_c3.c
sbc_fitpc2_wdt.c
sc520_wdt.c
sc1200wdt.c
sch311x_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
scx200_wdt.c
shwdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
sirfsoc_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
smsc37b787_wdt.c
softdog.c watchdog: refuse to unload softdog module when its timer is running 2015-12-27 21:02:21 +01:00
sp805_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
sp5100_tco.c sp5100_tco: fix the device check for SB800 and later chipsets 2015-12-27 20:42:55 +01:00
sp5100_tco.h
st_lpc_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
stmp3xxx_rtc_wdt.c watchdog: stmp3xxx: Stop the watchdog on system halt 2015-12-27 20:56:40 +01:00
sunxi_wdt.c watchdog: sunxi_wdt: use core restart handler 2015-12-13 15:30:00 +01:00
tangox_wdt.c watchdog: tangox: Print info message using pointer to platform device 2015-12-28 23:04:04 +01:00
tegra_wdt.c watchdog: tegra: Stop watchdog first if restarting 2015-11-23 08:59:45 +01:00
ts72xx_wdt.c char: make misc_deregister a void function 2015-08-05 10:35:49 -07:00
ts4800_wdt.c watchdog: ts4800: add driver for TS-4800 watchdog 2015-12-28 22:29:35 +01:00
twl4030_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
txx9wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
ux500_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
via_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
w83627hf_wdt.c watchdog: w83627hf_wdt: use core reboot notifier 2015-12-13 15:56:09 +01:00
w83877f_wdt.c
w83977f_wdt.c watchdog: w83977f_wdt: underflow in wdt_set_timeout() 2015-11-23 08:59:30 +01:00
wafer5823wdt.c
watchdog_core.c watchdog: Separate and maintain variables based on variable lifetime 2015-12-29 20:36:03 +01:00
watchdog_core.h watchdog: Create watchdog device in watchdog_dev.c 2015-12-29 20:36:01 +01:00
watchdog_dev.c watchdog: Separate and maintain variables based on variable lifetime 2015-12-29 20:36:03 +01:00
wd501p.h
wdrtas.c
wdt.c
wdt285.c
wdt977.c
wdt_pci.c
wm831x_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
wm8350_wdt.c Watchdog: Fix parent of watchdog_devices 2015-09-09 21:39:22 +02:00
xen_wdt.c watchdog: drop owner assignment from platform_drivers 2014-10-20 16:21:56 +02:00
ziirave_wdt.c watchdog: Zodiac Aerospace RAVE Switch Watchdog Processor Driver 2015-12-28 22:52:26 +01:00