]> Git Repo - linux.git/commitdiff
cpufreq: Acquire the lock in cpufreq_policy_restore() for reading
authorLan Tianyu <[email protected]>
Wed, 11 Sep 2013 07:05:05 +0000 (15:05 +0800)
committerRafael J. Wysocki <[email protected]>
Wed, 11 Sep 2013 21:30:03 +0000 (23:30 +0200)
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 <[email protected]>
Reviewed-by: Srivatsa S. Bhat <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/cpufreq/cpufreq.c

index d32040cc1c4670b9e447574dd689eaaa4af8d905..43c24aa756f6f29935af8eb0614945a442a36a19 100644 (file)
@@ -906,11 +906,11 @@ static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu)
        struct cpufreq_policy *policy;
        unsigned long flags;
 
-       write_lock_irqsave(&cpufreq_driver_lock, flags);
+       read_lock_irqsave(&cpufreq_driver_lock, flags);
 
        policy = per_cpu(cpufreq_cpu_data_fallback, cpu);
 
-       write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+       read_unlock_irqrestore(&cpufreq_driver_lock, flags);
 
        return policy;
 }
This page took 0.086777 seconds and 4 git commands to generate.