aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2013-09-11 03:05:05 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-11 17:30:03 -0400
commit44871c9c7f7963f8869dd8bc9620221c9e9db153 (patch)
tree06492eef7e60052d1a55f124b69f88727dbdbda1 /drivers/cpufreq/cpufreq.c
parentcb38ed5cf1c4fdb7454e4b48fb70c396f5acfb21 (diff)
cpufreq: Acquire the lock in cpufreq_policy_restore() for reading
In cpufreq_policy_restore() before system suspend policy is read from percpu's cpufreq_cpu_data_fallback. It's a read operation rather than a write one, so take the lock for reading in there. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index d32040cc1c46..43c24aa756f6 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -906,11 +906,11 @@ static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu)
906 struct cpufreq_policy *policy; 906 struct cpufreq_policy *policy;
907 unsigned long flags; 907 unsigned long flags;
908 908
909 write_lock_irqsave(&cpufreq_driver_lock, flags); 909 read_lock_irqsave(&cpufreq_driver_lock, flags);
910 910
911 policy = per_cpu(cpufreq_cpu_data_fallback, cpu); 911 policy = per_cpu(cpufreq_cpu_data_fallback, cpu);
912 912
913 write_unlock_irqrestore(&cpufreq_driver_lock, flags); 913 read_unlock_irqrestore(&cpufreq_driver_lock, flags);
914 914
915 return policy; 915 return policy;
916} 916}