OpenCloudOS-Kernel/drivers/base/power/opp
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
..
Makefile PM / OPP: Move CONFIG_OF dependent code in a separate file 2016-05-06 13:22:49 +02:00
core.c PM / OPP: Call notifier without holding opp_table->lock 2017-09-26 00:44:32 +02:00
cpu.c PM / OPP: Move away from RCU locking 2017-01-30 09:22:22 +01:00
debugfs.c PM / OPP: Don't create debugfs "supply-0" directory unnecessarily 2017-06-22 03:15:30 +02:00
of.c PM / OPP: Fix get sharing CPUs when hotplug is used 2017-08-01 14:10:55 +02:00
opp.h PM / OPP: Move away from RCU locking 2017-01-30 09:22:22 +01:00