aboutsummaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-08 22:02:25 +0100
committerMark Brown <broonie@linaro.org>2013-08-08 22:02:25 +0100
commit48851e288e1c7f87f13745b786caa7cd5d418fbb (patch)
tree64371198cc2c59a535740274a50e0cd019f03fb3 /drivers/cpufreq
parent72860ea3a6be3cfb16353922ec27eef5e34fdb0c (diff)
parent5afafbe8bf6678b37e55aedb86830223d0da23bf (diff)
downloadlinaro-lsk-48851e288e1c7f87f13745b786caa7cd5d418fbb.tar.gz
Merge remote-tracking branch 'lsk/v3.10/topic/tc2' into linux-linaro-lsk
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/arm_big_little.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 7c2be81f7dc..076f25a59e0 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -91,9 +91,14 @@ static unsigned int clk_get_cpu_rate(unsigned int cpu)
static unsigned int bL_cpufreq_get_rate(unsigned int cpu)
{
- pr_debug("%s: freq: %d\n", __func__, per_cpu(cpu_last_req_freq, cpu));
+ if (is_bL_switching_enabled()) {
+ pr_debug("%s: freq: %d\n", __func__, per_cpu(cpu_last_req_freq,
+ cpu));
- return per_cpu(cpu_last_req_freq, cpu);
+ return per_cpu(cpu_last_req_freq, cpu);
+ } else {
+ return clk_get_cpu_rate(cpu);
+ }
}
static unsigned int
@@ -101,14 +106,15 @@ bL_cpufreq_set_rate(u32 cpu, u32 old_cluster, u32 new_cluster, u32 rate)
{
u32 new_rate, prev_rate;
int ret;
+ bool bLs = is_bL_switching_enabled();
mutex_lock(&cluster_lock[new_cluster]);
- prev_rate = per_cpu(cpu_last_req_freq, cpu);
- per_cpu(cpu_last_req_freq, cpu) = rate;
- per_cpu(physical_cluster, cpu) = new_cluster;
+ if (bLs) {
+ prev_rate = per_cpu(cpu_last_req_freq, cpu);
+ per_cpu(cpu_last_req_freq, cpu) = rate;
+ per_cpu(physical_cluster, cpu) = new_cluster;
- if (is_bL_switching_enabled()) {
new_rate = find_cluster_maxfreq(new_cluster);
new_rate = ACTUAL_FREQ(new_cluster, new_rate);
} else {
@@ -122,8 +128,10 @@ bL_cpufreq_set_rate(u32 cpu, u32 old_cluster, u32 new_cluster, u32 rate)
if (WARN_ON(ret)) {
pr_err("clk_set_rate failed: %d, new cluster: %d\n", ret,
new_cluster);
- per_cpu(cpu_last_req_freq, cpu) = prev_rate;
- per_cpu(physical_cluster, cpu) = old_cluster;
+ if (bLs) {
+ per_cpu(cpu_last_req_freq, cpu) = prev_rate;
+ per_cpu(physical_cluster, cpu) = old_cluster;
+ }
mutex_unlock(&cluster_lock[new_cluster]);
@@ -463,7 +471,9 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
policy->cur = clk_get_cpu_rate(policy->cpu);
- per_cpu(cpu_last_req_freq, policy->cpu) = policy->cur;
+
+ if (is_bL_switching_enabled())
+ per_cpu(cpu_last_req_freq, policy->cpu) = policy->cur;
dev_info(cpu_dev, "%s: CPU %d initialized\n", __func__, policy->cpu);
return 0;