linux/drivers/watchdog
Arnd Bergmann 613655fa39 drivers: autoconvert trivial BKL users to private mutex
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

These drivers do not seem to be under active
maintainance from my brief investigation. Apologies
to those maintainers that I have missed.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
    else
            sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2010-10-05 15:01:04 +02:00
..
Kconfig watchdog: hpwdt (12/12): Make NMI decoding a compile-time option 2010-08-13 20:54:53 +00:00
Makefile watchdog: Adding support for ARM Primecell SP805 Watchdog 2010-08-08 18:22:25 +00:00
acquirewdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
advantechwdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
adx_wdt.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
alim1535_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
alim7101_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
ar7_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
at32ap700x_wdt.c watchdog: at32ap700x_wdt: register misc device last in probe() function 2010-06-17 09:56:57 +00:00
at91rm9200_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
at91sam9_wdt.c [WATCHDOG] Correct WDIOF_MAGICCLOSE flag 2009-06-18 07:30:57 +00:00
bcm47xx_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
bfin_wdt.c watchdog: bfin: use new common Blackfin watchdog header 2010-05-25 09:03:07 +00:00
booke_wdt.c watchdog: booke_wdt: fix ioctl status flags 2010-05-25 09:04:06 +00:00
coh901327_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
cpu5wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
cpwd.c drivers: autoconvert trivial BKL users to private mutex 2010-10-05 15:01:04 +02:00
davinci_wdt.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ep93xx_wdt.c watchdog: ep93xx_wdt.c fix default timout value in MODULE_PARM_DESC string. 2010-05-03 08:58:56 +00:00
eurotechwdt.c watchdog: update/improve/consolidate watchdog driver 2010-05-25 09:05:34 +00:00
f71808e_wdt.c watchdog: f71808e_wdt: new watchdog driver for Fintek F71808E and F71882FG 2010-08-08 18:21:42 +00:00
gef_wdt.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
geodewdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
hpwdt.c watchdog: hpwdt (12/12): Make NMI decoding a compile-time option 2010-08-13 20:54:53 +00:00
i6300esb.c [WATCHDOG] i6300esb.c: change platform_driver to pci_driver 2010-03-08 13:48:01 +00:00
iTCO_vendor.h
iTCO_vendor_support.c iTCO_wdt: fix TCO V1 timeout values and limits 2010-05-25 09:05:56 +00:00
iTCO_wdt.c iTCO_wdt: fix TCO V1 timeout values and limits 2010-05-25 09:05:56 +00:00
ib700wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
ibmasr.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
imx2_wdt.c watchdog: [PATCH 3/3] imx2_wdt: fix section mismatch 2010-06-13 08:20:06 +00:00
indydog.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
iop_wdt.c [WATCHDOG] sizeof cleanup 2009-09-18 08:39:37 +00:00
it87_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
it8712f_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
ixp4xx_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
ixp2000_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
ks8695_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
machzwd.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
max63xx_wdt.c [WATCHDOG] max63xx: be careful when disabling the watchdog 2010-04-16 12:26:27 +00:00
mixcomwd.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
mpc8xxx_wdt.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
mpcore_wdt.c ARM: 6126/1: ARM mpcore_wdt: fix build failure and other fixes 2010-05-12 11:18:14 +01:00
mtx-1_wdt.c [WATCHDOG] move platform probe and remove function to devinit and devexit 2009-06-18 07:30:44 +00:00
mv64x60_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
nuc900_wdt.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
octeon-wdt-main.c WATCHDOG: Add watchdog driver for OCTEON SOCs 2010-08-05 13:26:22 +01:00
octeon-wdt-nmi.S WATCHDOG: Add watchdog driver for OCTEON SOCs 2010-08-05 13:26:22 +01:00
omap_wdt.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
omap_wdt.h
orion_wdt.c [ARM] Orion/Kirkwood: rename orion5x_wdt to orion_wdt 2009-06-08 13:05:00 -04:00
pc87413_wdt.c watchdog: fix several MODULE_PARM_DESC strings 2010-05-25 09:03:52 +00:00
pcwd.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
pcwd_pci.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
pcwd_usb.c USB: rename usb_buffer_alloc() and usb_buffer_free() users 2010-05-20 13:21:38 -07:00
pika_wdt.c [WATCHDOG] powerpc: pika_wdt ident cannot be const 2010-04-03 22:22:20 +00:00
pnx833x_wdt.c watchdog: fix several MODULE_PARM_DESC strings 2010-05-25 09:03:52 +00:00
pnx4008_wdt.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
rc32434_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
rdc321x_wdt.c mfd: Change rdc321x resources flags to IORESOURCE_IO 2010-05-28 01:37:52 +02:00
riowd.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
s3c2410_wdt.c watchdog: s3c2410_wdt - Fix removing of platform device 2010-08-08 18:20:09 +00:00
sa1100_wdt.c [WATCHDOG] SA1100 watchdog maximum timeout 2009-07-09 18:29:38 +00:00
sb_wdog.c Watchdog: sb_wdog.c: Fix sibyte watchdog initialization 2010-04-26 18:14:03 +00:00
sbc60xxwdt.c [WATCHDOG] Some more general cleanup 2009-06-18 07:30:30 +00:00
sbc7240_wdt.c
sbc8360.c [WATCHDOG] Some more general cleanup 2009-06-18 07:30:30 +00:00
sbc_epx_c3.c [WATCHDOG] Correct WDIOF_MAGICCLOSE flag 2009-06-18 07:30:57 +00:00
sbc_fitpc2_wdt.c watchdog: sbc_fitpc2_wdt: fixed "scheduling while atomic" bug. 2010-04-26 18:22:30 +00:00
sc520_wdt.c [WATCHDOG] More coding-style and trivial clean-up 2009-03-25 09:07:04 +00:00
sc1200wdt.c [WATCHDOG] sizeof cleanup 2009-09-18 08:39:37 +00:00
sch311x_wdt.c watchdog: sch311x_wdt.c: set parent before registeriing the misc device in probe() function 2010-08-08 18:21:15 +00:00
scx200_wdt.c [WATCHDOG] Correct WDIOF_MAGICCLOSE flag 2009-06-18 07:30:57 +00:00
shwdt.c watchdog: fix several MODULE_PARM_DESC strings 2010-05-25 09:03:52 +00:00
smsc37b787_wdt.c [WATCHDOG] More coding-style and trivial clean-up 2009-03-25 09:07:04 +00:00
softdog.c [WATCHDOG] Some more general cleanup 2009-06-18 07:30:30 +00:00
sp805_wdt.c watchdog: Adding support for ARM Primecell SP805 Watchdog 2010-08-08 18:22:25 +00:00
stmp3xxx_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
ts72xx_wdt.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
twl4030_wdt.c watchdog: twl4030_wdt: Disable watchdog during probing 2010-05-25 09:05:46 +00:00
txx9wdt.c [WATCHDOG] change reboot_notifier to platform-shutdown method. 2010-03-07 10:30:59 +00:00
w83627hf_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
w83697hf_wdt.c [WATCHDOG] Some more general cleanup 2009-06-18 07:30:30 +00:00
w83697ug_wdt.c [WATCHDOG] w83697ug, fix lock imbalance 2009-07-09 18:29:16 +00:00
w83877f_wdt.c
w83977f_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
wafer5823wdt.c
wd501p.h [WATCHDOG] More coding-style and trivial clean-up 2009-03-25 09:07:04 +00:00
wdrtas.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
wdt.c watchdog: update/improve/consolidate watchdog driver 2010-05-25 09:05:34 +00:00
wdt285.c
wdt977.c watchdog: fix several MODULE_PARM_DESC strings 2010-05-25 09:03:52 +00:00
wdt_pci.c watchdog: wdt_pci.c: move ids to pci_ids.h 2010-08-08 18:20:38 +00:00
wm831x_wdt.c [WATCHDOG] watchdog_info constify 2010-03-07 10:30:57 +00:00
wm8350_wdt.c [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference 2010-06-07 15:55:03 +00:00