diff mbox

[RFC,V3,3/3] Cpufreq: Hold cpu_add_remove_lock before change cpufreq_suspended flag

Message ID 1411633925-9018-4-git-send-email-tianyu.lan@intel.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

lan,Tianyu Sept. 25, 2014, 8:32 a.m. UTC
Now, enabling non-boot cpus will parallel with resuming devices.
Cpu online may take place after cpufreq resume. But all cpu should be up
before clearing cpufreq_suspended flag in the cpufreq_resume(). Cpufreq
core uses this flag to decide to do light-weight init or full init. Light
-weight init/tear down is dedicated for cpu hotplug during system pm. To
keep this rule, hold cpu_add_remove_lock during changing cpufreq_suspended
flag.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 drivers/cpufreq/cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 37951ec..b03f7dd 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1689,7 +1689,9 @@  void cpufreq_resume(void)
 	if (!cpufreq_driver)
 		return;
 
+	cpu_maps_update_begin();
 	cpufreq_suspended = false;
+	cpu_maps_update_done();
 
 	if (!has_target())
 		return;