linux-stable/drivers/base
Viresh Kumar e4d8ae0016 PM / OPP: Call notifier without holding opp_table->lock
The notifier callbacks may want to call some OPP helper routines which
may try to take the same opp_table->lock again and cause a deadlock. One
such usecase was reported by Chanwoo Choi, where calling
dev_pm_opp_disable() leads us to the devfreq's OPP notifier handler,
which further calls dev_pm_opp_find_freq_floor() and it deadlocks.

We don't really need the opp_table->lock to be held across the notifier
call though, all we want to make sure is that the 'opp' doesn't get
freed while being used from within the notifier chain. We can do it with
help of dev_pm_opp_get/put() as well. Let's do it.

Cc: 4.11+ <stable@vger.kernel.org> # 4.11+
Fixes: 5b650b3888 "PM / OPP: Take kref from _find_opp_table()"
Reported-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-09-26 00:44:32 +02:00
..
power PM / OPP: Call notifier without holding opp_table->lock 2017-09-26 00:44:32 +02:00
regmap regmap: regmap-w1: Fix build troubles 2017-07-17 15:53:00 +01:00
test
arch_topology.c base: Convert to using %pOF instead of full_name 2017-08-28 17:47:55 +02:00
attribute_container.c
base.h driver core: make device_{add|remove}_groups() public 2017-07-22 11:59:23 +02:00
bus.c driver core: bus: Fix a potential double free 2017-08-31 18:57:30 +02:00
cacheinfo.c
class.c driver core: remove class_attrs from struct class 2017-06-09 10:41:00 +02:00
component.c
container.c
core.c Do not disable driver and bus shutdown hook when class shutdown hook is set. 2017-08-28 18:02:46 +02:00
cpu.c treewide: make "nr_cpu_ids" unsigned 2017-09-08 18:26:48 -07:00
dd.c initcall_debug: add deferred probe times 2017-08-03 17:48:49 -07:00
devcoredump.c
devres.c
devtmpfs.c
dma-coherent.c dma-coherent: fix rmem_dma_device_init regression 2017-09-17 08:20:02 -07:00
dma-contiguous.c
dma-mapping.c dma-coherent: remove the DMA_MEMORY_MAP and DMA_MEMORY_IO flags 2017-09-01 11:59:17 +02:00
driver.c
firmware.c
firmware_class.c Revert "firmware: add sanity check on shutdown/suspend" 2017-09-10 21:19:06 -07:00
hypervisor.c
init.c
isa.c
Kconfig firmware: Restore support for built-in firmware 2017-09-16 10:58:48 -07:00
Makefile arm, arm64: factorize common cpu capacity default code 2017-06-03 19:10:09 +09:00
map.c
memory.c mm, memory_hotplug: remove zone restrictions 2017-09-06 17:27:25 -07:00
module.c
node.c mm: change the call sites of numa statistics items 2017-09-08 18:26:47 -07:00
pinctrl.c driver core: fix automatic pinctrl management 2017-06-13 11:07:32 +02:00
platform-msi.c irqchip/MSI: Use irq_domain_update_bus_token instead of an open coded access 2017-06-22 18:29:17 +02:00
platform.c This is the bulk of GPIO changes for the v4.13 series: 2017-07-07 12:40:27 -07:00
property.c device property: Introduce fwnode_property_get_reference_args 2017-07-22 00:04:51 +02:00
soc.c
syscore.c
topology.c base: topology: constify attribute_group structures. 2017-08-28 17:49:22 +02:00
transport_class.c