android_kernel_google_msm/drivers
Matt Wagantall 6b7881f3af cpufreq: ondemand: Fix hotplug deadlock with store_powersave_bias
store_powersave_bias() acquires the hotplug lock and the dbs_mutex
lock, but does so in the wrong order.  Deadlocks like the following
can result.

Thread A:
    get_online_cpus+0x3c/0x5c           <- acquires 'cpu_hotplug.lock'
    store_powersave_bias+0x80/0x3f4     <- acquires 'dbs_mutex'
    kobj_attr_store+0x14/0x20
    sysfs_write_file+0x108/0x13c
    vfs_write+0xb0/0x128
    sys_write+0x38/0x64

Thread B:
    cpufreq_governor_dbs+0x7c/0x55c     <- acquires 'dbs_mutex'
    __cpufreq_governor+0x90/0xe0
    __cpufreq_set_policy+0x1b0/0x258
    cpufreq_add_dev_interface+0x2cc/0x334
    cpufreq_add_dev+0x514/0x580
    cpufreq_cpu_callback+0x88/0x9c
    notifier_call_chain+0x38/0x68
    __cpu_notify+0x28/0x40
    _cpu_up+0xe4/0x118                  <- acquires 'cpu_hotplug.lock'
    cpu_up+0x64/0x80
    store_online+0x48/0x78
    dev_attr_store+0x18/0x24
    sysfs_write_file+0x108/0x13c
    vfs_write+0xb0/0x128
    sys_write+0x38/0x64

Fix this by flipping the order in which the locks are acquired and
released in store_powersave_bias so that it is the same as in the
hotplug path.

Change-Id: Idc59fb29d60b8f7fceb8ed0f2bb9eff4670abda7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-10-29 23:12:13 +08:00
..
accessibility
acpi
amba
ata
atm
auxdisplay
base sync: Fix a race condition between release_obj and print_obj 2013-12-09 16:11:59 -08:00
bcma
block
bluetooth Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
cdrom
char diag: Fix possible underflow/overflow issues 2016-06-03 11:57:55 -07:00
clk
clocksource
connector
coresight coresight: do not probe if cpu is not online 2013-03-15 17:09:34 -07:00
cpufreq cpufreq: ondemand: Fix hotplug deadlock with store_powersave_bias 2016-10-29 23:12:13 +08:00
cpuidle
crypto crypto: msm: Check for invalid byte offset field 2013-06-18 12:10:23 -07:00
dca
devfreq
dio
dma
edac
eisa
firewire
firmware
gpio gpio: msm-common: Fix irq_set_type for dual edge trigger 2013-06-25 21:28:40 +00:00
gpu msm: kgsl: Defer adding the mem entry to a process 2016-06-13 15:49:37 -07:00
gud
hid
hsi
hv
hwmon Cap1106: To prevent Deadlock while switching on/off CapSensor 2013-07-15 17:58:28 +00:00
hwspinlock
i2c Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
ide
idle
ieee802154
infiniband
input keys: notify system preparing to force reset if resetkey is defined 2015-05-07 17:17:45 +00:00
iommu iommu/core: pass a user-provided token to fault handlers 2013-09-06 16:20:47 -07:00
isdn
leds display: JDI: config backlight level when kernel init 2013-04-18 16:09:22 -07:00
lguest
macintosh
mca
md
media msm📷isp: fix array index bound checks 2016-06-03 11:55:33 -07:00
memstick
message
mfd random: remove rand_initialize_irq() 2013-09-09 17:01:42 -07:00
misc qseecom: initialize data->type on device open 2016-07-01 16:18:10 -07:00
mmc mmc: core : fix arbitrary read/write to user space 2016-05-18 10:45:44 -07:00
mtd Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
net BACKPORT: usbnet: cleanup after bind() in probe() 2016-06-15 10:29:17 -07:00
nfc Remove a workaround since BCM20793 chip default is 7 bits address. 2013-04-18 16:07:56 -07:00
nubus
of Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
oprofile
parisc
parport
pci
pcmcia
pinctrl
platform msm: Change the permissions of sps debug files 2013-06-07 11:25:53 -07:00
pnp
power power: bq27541: cancel poll work first to prevent querying gauge interleaved 2013-12-12 23:04:27 +00:00
pps
ps3
ptp
rapidio
regulator Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
remoteproc iommu/core: pass a user-provided token to fault handlers 2013-09-06 16:20:47 -07:00
rpmsg
rtc Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
s390
sbus
scsi
sfi
sh
slimbus Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
sn
spi Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
spmi Update copyright to The Linux Foundation 2013-03-15 17:07:39 -07:00
ssb
staging wlan: Replace snprintf with scnprintf 2016-06-02 10:13:47 -07:00
switch switch: Reset device's drvdata before destroying it 2013-03-15 17:13:04 -07:00
target
tc
thermal thermal: pm8xxx-tm: Add configuration option for allowing shutdown override 2013-03-15 17:08:32 -07:00
tty tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) 2016-05-24 22:07:31 +00:00
uio Fix a few incorrectly checked [io_]remap_pfn_range() calls 2014-07-15 17:06:52 -07:00
usb usb: gadget: mass_storage: added sysfs entry for cdrom to LUNs 2016-10-29 23:12:10 +08:00
uwb
vhost
video msm: video: Checks for code robustness 2016-10-29 23:12:12 +08:00
virt
virtio
vlynq
w1
watchdog
xen
zorro
Kconfig
Makefile drivers: usb: otg: Report the charger type and enable the USB host mode according to the ID pin status and the SlimPort status. 2013-04-18 16:07:58 -07:00