aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorSekhar Nori <nsekhar@ti.com>2010-07-20 07:16:48 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-09-24 10:40:23 -0400
commitfca97b3337edb6b12707d167460b224dd8ef6052 (patch)
tree135f93d4c852af28cd767d1b015be2b712cda7a6 /arch/arm
parentc89f1681450822c74afb3217ed4c24a177a23f43 (diff)
davinci: cpufreq: bailout on regulator errors
Current cpufreq code does not consider errors that can occur while changing voltage. Code to increase CPU frequency goes ahead even in the case the regulator has failed to increase the voltage. This leads to hard error since lower voltages cannot support increased frequency. Prevent this by not increasing frequency in case increasing voltage is not successful. Also, do not lower the voltage if changing the cpu frequency has failed for some reason. Note that we do not return error on failure to decrease voltage as that is not a hard error. Build fix for non-cpufreq kernels by Caglar Akyuz. Signed-off-by: Sekhar Nori <nsekhar@ti.com> Cc: Caglar Akyuz <caglar@bilkon-kontrol.com.tr> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-davinci/cpufreq.c10
-rw-r--r--arch/arm/mach-davinci/da850.c2
2 files changed, 9 insertions, 3 deletions
diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c
index d3fa6de1e20f..bc8014279114 100644
--- a/arch/arm/mach-davinci/cpufreq.c
+++ b/arch/arm/mach-davinci/cpufreq.c
@@ -104,15 +104,21 @@ static int davinci_target(struct cpufreq_policy *policy,
104 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 104 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
105 105
106 /* if moving to higher frequency, up the voltage beforehand */ 106 /* if moving to higher frequency, up the voltage beforehand */
107 if (pdata->set_voltage && freqs.new > freqs.old) 107 if (pdata->set_voltage && freqs.new > freqs.old) {
108 pdata->set_voltage(idx); 108 ret = pdata->set_voltage(idx);
109 if (ret)
110 goto out;
111 }
109 112
110 ret = clk_set_rate(armclk, idx); 113 ret = clk_set_rate(armclk, idx);
114 if (ret)
115 goto out;
111 116
112 /* if moving to lower freq, lower the voltage after lowering freq */ 117 /* if moving to lower freq, lower the voltage after lowering freq */
113 if (pdata->set_voltage && freqs.new < freqs.old) 118 if (pdata->set_voltage && freqs.new < freqs.old)
114 pdata->set_voltage(idx); 119 pdata->set_voltage(idx);
115 120
121out:
116 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 122 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
117 123
118 return ret; 124 return ret;
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 68ed58a48252..868227e66cea 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -983,7 +983,7 @@ static int da850_set_pll0rate(struct clk *clk, unsigned long index)
983 return 0; 983 return 0;
984} 984}
985#else 985#else
986int __init da850_register_cpufreq(void) 986int __init da850_register_cpufreq(char *async_clk)
987{ 987{
988 return 0; 988 return 0;
989} 989}