diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2017-03-10 19:33:28 +0100 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2017-03-13 03:06:04 +0100 |
commit | 088db931e065bd3b159fa2e588eab859ef0d9d23 (patch) | |
tree | 7211f7bc220cfc430e37dc4fa37dec978efbe0f7 /drivers/thermal/devfreq_cooling.c | |
parent | Linux 4.11-rc2 (diff) | |
download | linux-088db931e065bd3b159fa2e588eab859ef0d9d23.tar.xz linux-088db931e065bd3b159fa2e588eab859ef0d9d23.zip |
thermal: Fix potential deadlock in cpu_cooling
cooling_list_lock is covering not just cpufreq_dev_count, but also the
calls to cpufreq_register_notifier() and cpufreq_unregister_notifier().
Since cooling_list_lock is also used within cpufreq_thermal_notifier(),
lockdep reports a potential deadlock. Fix it by testing the condition
under cooling_list_lock and dropping the lock before calling
cpufreq_register_notifier(). And variable cpufreq_dev_count is removed
at the same time, because it's no longer needed after the fix.
Fixes: ae606089621e ("thermal: convert cpu_cooling to use an IDA")
Reported-and-Tested-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/devfreq_cooling.c')
0 files changed, 0 insertions, 0 deletions