aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2007-10-09 20:18:27 -0400
committerDave Jones <davej@redhat.com>2007-10-09 21:44:06 -0400
commit9eb59573d4b86f347e6cd04f47a4c2082009fa58 (patch)
tree91209b4149bf791c36ed50da3d0261f491cd27b4 /drivers/cpufreq
parent562d94d98f7032bdc4a99d9124a78a543dbea225 (diff)
[CPUFREQ] Don't take semaphore in cpufreq_quick_get()
I don't see any reason to take an expensive lock in cpufreq_quick_get() Reading policy->cur is a single atomic operation and after the lock is dropped again the state could change any time anyways. So don't take the lock in the first place. This also makes this function interrupt safe which is useful for some code of mine. Signed-off-by: Andi Kleen <ak@suse.de> Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index e027052a660..f7b9d6fce12 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1111,12 +1111,7 @@ unsigned int cpufreq_quick_get(unsigned int cpu)
1111 unsigned int ret_freq = 0; 1111 unsigned int ret_freq = 0;
1112 1112
1113 if (policy) { 1113 if (policy) {
1114 if (unlikely(lock_policy_rwsem_read(cpu)))
1115 return ret_freq;
1116
1117 ret_freq = policy->cur; 1114 ret_freq = policy->cur;
1118
1119 unlock_policy_rwsem_read(cpu);
1120 cpufreq_cpu_put(policy); 1115 cpufreq_cpu_put(policy);
1121 } 1116 }
1122 1117