alistair23-linux/drivers
Lothar Waßmann dca0261393 [CPUFREQ] fix double unlock of cpu_policy_rwsem in drivers/cpufreq/cpufreq.c
In drivers/cpufreq/cpufreq.c the function cpufreq_add_dev() takes the
error exit 'err_out_unregister' from different places once with the
'cpu_policy_rwsem' lock held, once with the lock released:
|		if (ret)
|			goto err_out_unregister;
|	}
|
|	policy->governor = NULL; /* to assure that the starting sequence is
|				  * run in cpufreq_set_policy */
|
|	/* set default policy */
|	ret = __cpufreq_set_policy(policy, &new_policy);
|	policy->user_policy.policy = policy->policy;
|	policy->user_policy.governor = policy->governor;
|
|	unlock_policy_rwsem_write(cpu);
|
|	if (ret) {
|		dprintk("setting policy failed\n");
|		goto err_out_unregister;
|	}

This leads to the following error message in case of a failing
__cpufreq_set_policy() call:
=====================================
[ BUG: bad unlock balance detected! ]
-------------------------------------
swapper/1 is trying to release lock (&per_cpu(cpu_policy_rwsem, cpu)) at:
[<c01b4564>] unlock_policy_rwsem_write+0x30/0x40
but there are no more locks to release!

other info that might help us debug this:
1 lock held by swapper/1:
 #0:  (sysdev_drivers_lock){--..}, at: [<c018fd18>] sysdev_driver_register+0x74/0x130

stack backtrace:
[<c002f588>] (dump_stack+0x0/0x14) from [<c00692fc>] (print_unlock_inbalance_bug+0xc8/0x104)
[<c0069234>] (print_unlock_inbalance_bug+0x0/0x104) from [<c006b7ac>] (lock_release_non_nested+0xc4/0x19c)
 r6:00000028 r5:c3c1ab80 r4:c01b4564
[<c006b6e8>] (lock_release_non_nested+0x0/0x19c) from [<c006b9e0>] (lock_release+0x15c/0x18c)
 r8:60000013 r7:00000001 r6:c01b4564 r5:c0541bb4 r4:c3c1ab80
[<c006b884>] (lock_release+0x0/0x18c) from [<c0061ba0>] (up_write+0x24/0x30)
 r8:c0541b80 r7:00000000 r6:ffffffea r5:c3c34828 r4:c0541b8c
[<c0061b7c>] (up_write+0x0/0x30) from [<c01b4564>] (unlock_policy_rwsem_write+0x30/0x40)
 r4:c3c34884
[<c01b4534>] (unlock_policy_rwsem_write+0x0/0x40) from [<c01b4c40>] (cpufreq_add_dev+0x324/0x398)
[<c01b491c>] (cpufreq_add_dev+0x0/0x398) from [<c018fd64>] (sysdev_driver_register+0xc0/0x130)
[<c018fca4>] (sysdev_driver_register+0x0/0x130) from [<c01b3574>] (cpufreq_register_driver+0xbc/0x174)

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Dave Jones <davej@redhat.com>
2008-05-29 12:10:12 -04:00
..
accessibility
acorn/char
acpi
amba
ata
atm
auxdisplay
base Clean up 'print_fn_descriptor_symbol()' types 2008-05-15 17:50:37 -07:00
block m68k: Return -ENODEV if no device is found 2008-05-18 13:28:50 -07:00
bluetooth
cdrom
char Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2008-05-19 13:30:40 -07:00
clocksource
connector
cpufreq [CPUFREQ] fix double unlock of cpu_policy_rwsem in drivers/cpufreq/cpufreq.c 2008-05-29 12:10:12 -04:00
cpuidle
crypto
dca
dio
dma
edac
eisa
firewire
firmware
gpio
hid
hwmon
i2c i2c/max6875: Really prevent 24RF08 corruption 2008-05-18 20:49:41 +02:00
ide m68k: macide doesnt check for Mac 2008-05-18 13:28:49 -07:00
ieee1394
infiniband RDMA/cxgb3: Wrap the software send queue pointer as needed on flush 2008-05-13 11:52:55 -07:00
input m68k: Return -ENODEV if no device is found 2008-05-18 13:28:50 -07:00
isdn
leds
lguest
macintosh [POWERPC] macintosh: Replace deprecated __initcall with device_initcall 2008-05-15 20:50:00 +10:00
mca
md Remove blkdev warning triggered by using md 2008-05-14 19:11:15 -07:00
media Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 2008-05-18 13:56:54 -07:00
memstick
message
mfd
misc
mmc
mtd
net m68k: Some network drivers do not check the platform 2008-05-18 13:28:49 -07:00
nubus
of [POWERPC] Add null pointer check to of_find_property 2008-05-15 20:49:49 +10:00
oprofile oprofile: don't request cache line alignment for cpu_buffer 2008-05-14 19:11:12 -07:00
parisc drivers/parisc: replace remaining __FUNCTION__ occurrences 2008-05-15 10:38:54 -04:00
parport
pci Clean up 'print_fn_descriptor_symbol()' types 2008-05-15 17:50:37 -07:00
pcmcia
pnp Clean up 'print_fn_descriptor_symbol()' types 2008-05-15 17:50:37 -07:00
power
ps3
rapidio
rtc rtc: m41t80: include <linux/kernel.h> for printk() 2008-05-13 08:02:26 -07:00
s390 [S390] tape: Use ccw_dev_id to build cdev_id. 2008-05-15 16:52:40 +02:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2008-05-13 11:24:51 -07:00
serial m68knommu: add info about removing mcfserial 2008-05-14 19:11:12 -07:00
sh
sn
spi mpc5200_psc_spi: typo fix in header block 2008-05-14 19:11:12 -07:00
ssb
tc
telephony
thermal
uio
usb USB: atmel_usba_udc fixes, mostly disconnect() 2008-05-14 10:00:30 -07:00
video m68k: Return -ENODEV if no device is found 2008-05-18 13:28:50 -07:00
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile