android_kernel_google_msm/drivers/regulator
Stephen Boyd c4a66212b1 regulator: Fix recursive mutex lockdep warning
A recursive lockdep warning occurs if you call
regulator_set_optimum_mode() on a regulator with a supply because
there is no nesting annotation for the rdev->mutex. To avoid this
warning, get the supply's load before locking the regulator's
mutex to avoid grabbing the same class of lock twice.

=============================================
[ INFO: possible recursive locking detected ]
3.4.0 #3257 Tainted: G        W
---------------------------------------------
swapper/0/1 is trying to acquire lock:
 (&rdev->mutex){+.+.+.}, at: [<c036e9e0>] regulator_get_voltage+0x18/0x38

but task is already holding lock:
 (&rdev->mutex){+.+.+.}, at: [<c036ef38>]
 regulator_set_optimum_mode+0x24/0x224

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&rdev->mutex);
  lock(&rdev->mutex);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by swapper/0/1:
 #0:  (&__lockdep_no_validate__){......}, at: [<c03dbb48>]
 __driver_attach+0x40/0x8c
 #1:  (&__lockdep_no_validate__){......}, at: [<c03dbb58>]
 __driver_attach+0x50/0x8c
 #2:  (&rdev->mutex){+.+.+.}, at: [<c036ef38>]
 regulator_set_optimum_mode+0x24/0x224

stack backtrace:
[<c001521c>] (unwind_backtrace+0x0/0x12c) from [<c00cc4d4>]
(validate_chain+0x760/0x1080)
[<c00cc4d4>] (validate_chain+0x760/0x1080) from [<c00cd744>]
(__lock_acquire+0x950/0xa10)
[<c00cd744>] (__lock_acquire+0x950/0xa10) from [<c00cd990>]
(lock_acquire+0x18c/0x1e8)
[<c00cd990>] (lock_acquire+0x18c/0x1e8) from [<c080c248>]
(mutex_lock_nested+0x68/0x3c4)
[<c080c248>] (mutex_lock_nested+0x68/0x3c4) from [<c036e9e0>]
(regulator_get_voltage+0x18/0x38)
[<c036e9e0>] (regulator_get_voltage+0x18/0x38) from [<c036efb8>]
(regulator_set_optimum_mode+0xa4/0x224)
[<c036efb8>] (regulator_set_optimum_mode+0xa4/0x224) from [<c07df3d0>]
(sample_driver_probe+0xf0/0x314)

Change-Id: I9934a4b4b9dbb948ca87154e9ad5ce909732fe21
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-27 18:15:33 -08:00
..
88pm8607.c
aat2870-regulator.c
ab3100.c
ab8500.c
ad5398.c
anatop-regulator.c regulator: Fix a build warning in the anatop driver for 3.4 2012-04-10 10:26:41 -07:00
core.c regulator: Fix recursive mutex lockdep warning 2013-02-27 18:15:33 -08:00
da903x.c
da9052-regulator.c
db8500-prcmu.c
dbx500-prcmu.c
dbx500-prcmu.h
dummy.c
dummy.h
fixed-helper.c regulator: Remove non-existent parameter from fixed-helper.c kernel doc 2012-03-31 19:41:20 +01:00
fixed.c
gpio-regulator.c
isl6271a-regulator.c
Kconfig spmi: Rename qpnp library to be part of the spmi framework 2013-02-27 18:13:11 -08:00
lp3971.c
lp3972.c
Makefile regulator: Add qpnp-regulator driver 2013-02-25 11:33:44 -08:00
max1586.c
max8649.c
max8660.c
max8925-regulator.c
max8952.c
max8997.c regulator: Fix the logic to ensure new voltage setting in valid range 2012-04-17 15:17:11 +01:00
max8998.c
mc13xxx-regulator-core.c
mc13xxx.h
mc13783-regulator.c
mc13892-regulator.c
msm-gpio-regulator.c regulator: msm-gpio-regulator: Correct gpio_request error handling 2013-02-27 18:10:42 -08:00
of_regulator.c regulator: Extend of_get_regulator_init_data to support non-DT consumers 2013-02-25 11:33:46 -08:00
pcap-regulator.c
pcf50633-regulator.c
pm8xxx-regulator.c regulator: pm8xxx-regulator: add PM8XXX regulator driver 2013-02-25 11:33:41 -08:00
pm8058-xo.c regulator: add pm8058 xo buffer driver 2013-02-25 11:33:43 -08:00
pmic8058-regulator.c regulator: pmic8058-regulator: add support for PMIC8058 regulator 2013-02-25 11:33:39 -08:00
pmic8901-regulator.c regulator: pmic8901-regulator: Add support for PMIC8901 regulator 2013-02-25 11:33:40 -08:00
qpnp-regulator.c spmi: qpnp: Change APIs to take a spmi_resource pointer instead of index 2013-02-27 18:13:11 -08:00
s5m8767.c regulator: Fix setting new voltage in s5m8767_set_voltage 2012-03-31 11:26:19 +01:00
stub-regulator.c regulator: Add stub regulator support 2013-02-25 11:33:44 -08:00
tps6105x-regulator.c
tps6507x-regulator.c
tps6524x-regulator.c
tps6586x-regulator.c
tps62360-regulator.c
tps65023-regulator.c
tps65217-regulator.c
tps65910-regulator.c
tps65912-regulator.c
twl-regulator.c
userspace-consumer.c
virtual.c
wm831x-dcdc.c regulator: wm831x-dcdc: Fix the logic to choose best current limit setting 2012-03-28 12:44:07 +01:00
wm831x-isink.c regulator: wm831x-isink: Fix the logic to choose best current limit setting 2012-03-28 12:44:07 +01:00
wm831x-ldo.c regulator: Fix setting low power mode for wm831x aldo 2012-03-29 12:06:24 +01:00
wm8350-regulator.c regulator: Only update [LDOx|DCx]_HIB_MODE bits in wm8350_[ldo|dcdc]_set_suspend_disable 2012-03-29 12:06:24 +01:00
wm8400-regulator.c
wm8994-regulator.c