linux-sg2042/drivers/base/power
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
..
opp PM / OPP: Call notifier without holding opp_table->lock 2017-09-26 00:44:32 +02:00
Makefile PM / OPP: Move opp core to its own directory 2015-09-15 02:03:16 +02:00
clock_ops.c PM / clk: Add support for adding a specific clock from device-tree 2016-06-28 00:42:10 +02:00
common.c PM: Avoid false-positive warnings in dev_pm_domain_set() 2016-02-03 19:10:37 +01:00
domain.c PM / Domains: Convert to using %pOF instead of full_name 2017-08-25 01:19:36 +02:00
domain_governor.c PM / Domains: Fix missing default_power_down_ok comment 2017-06-29 01:24:36 +02:00
generic_ops.c PM / PCI / ACPI: Kick devices that might have been reset by firmware 2015-10-14 02:17:34 +02:00
main.c PM: core: Fix device_pm_check_callbacks() 2017-09-19 22:58:27 +02:00
power.h Driver core patches for 4.10-rc1 2016-12-13 11:42:18 -08:00
qos.c PM / QoS: Use the correct variable to check the QoS request type 2017-09-18 13:38:30 +02:00
runtime.c sched/headers: Prepare to move the memalloc_noio_*() APIs to <linux/sched/mm.h> 2017-03-02 08:42:33 +01:00
sysfs.c PM / QoS: return -EINVAL for bogus strings 2017-07-12 14:42:37 +02:00
trace.c timekeeping: Ignore the bogus sleep time if pm_trace is enabled 2016-11-29 18:02:58 +01:00
wakeirq.c PM / wakeirq: report a wakeup_event on dedicated wekup irq 2017-02-13 22:29:30 +01:00
wakeup.c Merge branch 'pm-sleep' 2017-09-04 00:06:02 +02:00