Skip to content
Commit 088db931 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Zhang Rui
Browse files

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: ae606089 ("thermal: convert cpu_cooling to use an IDA")
Reported-and-Tested-by: default avatarRussell King <linux@armlinux.org.uk>
Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 4495c08e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment