aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/exynos-cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-06-19 01:48:20 -0400
committerViresh Kumar <viresh.kumar@linaro.org>2013-06-24 08:48:59 -0400
commitc3aca6b1ce17a2e866788bc2bd40e25ef6e5ba58 (patch)
tree6fd0c7e0084f6371c6f8a0651b9a46c4e0587209 /drivers/cpufreq/exynos-cpufreq.c
parent803c126af699602561a3ddb1814354993e4395b6 (diff)
cpufreq: exynos: call CPUFREQ_POSTCHANGE notfier in error cases
PRECHANGE and POSTCHANGE notifiers must be called in groups, i.e either both should be called or both shouldn't be. In case we have started PRECHANGE notifier and found an error, we must call POSTCHANGE notifier with freqs.new = freqs.old to guarantee that sequence of calling notifiers is complete. This patch fixes it. Cc: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/exynos-cpufreq.c')
-rw-r--r--drivers/cpufreq/exynos-cpufreq.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 475b4f607f0d..0d32f02ef4d6 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -113,7 +113,8 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
113 if (ret) { 113 if (ret) {
114 pr_err("%s: failed to set cpu voltage to %d\n", 114 pr_err("%s: failed to set cpu voltage to %d\n",
115 __func__, arm_volt); 115 __func__, arm_volt);
116 goto out; 116 freqs.new = freqs.old;
117 goto post_notify;
117 } 118 }
118 } 119 }
119 120
@@ -123,14 +124,19 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
123 if (ret) { 124 if (ret) {
124 pr_err("%s: failed to set cpu voltage to %d\n", 125 pr_err("%s: failed to set cpu voltage to %d\n",
125 __func__, safe_arm_volt); 126 __func__, safe_arm_volt);
126 goto out; 127 freqs.new = freqs.old;
128 goto post_notify;
127 } 129 }
128 } 130 }
129 131
130 exynos_info->set_freq(old_index, index); 132 exynos_info->set_freq(old_index, index);
131 133
134post_notify:
132 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); 135 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
133 136
137 if (ret)
138 goto out;
139
134 /* When the new frequency is lower than current frequency */ 140 /* When the new frequency is lower than current frequency */
135 if ((freqs.new < freqs.old) || 141 if ((freqs.new < freqs.old) ||
136 ((freqs.new > freqs.old) && safe_arm_volt)) { 142 ((freqs.new > freqs.old) && safe_arm_volt)) {