aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-06-19 04:52:55 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-24 07:14:59 -0400
commite15d8309e961ea960dbe40f94fd7ac64f8efe3f6 (patch)
treeb6ce75c518b1f92d0d82da71eb8522e64b64e236 /drivers/cpufreq
parent0956df9c842a534b0b36f62f3a0fdb5fca19dc96 (diff)
cpufreq: ACPI: 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 the sequence of calling notifiers is complete. This patch fixes it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/acpi-cpufreq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 0d25677fb37d..1f9849da4278 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -494,12 +494,14 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
494 pr_debug("acpi_cpufreq_target failed (%d)\n", 494 pr_debug("acpi_cpufreq_target failed (%d)\n",
495 policy->cpu); 495 policy->cpu);
496 result = -EAGAIN; 496 result = -EAGAIN;
497 goto out; 497 freqs.new = freqs.old;
498 } 498 }
499 } 499 }
500 500
501 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); 501 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
502 perf->state = next_perf_state; 502
503 if (!result)
504 perf->state = next_perf_state;
503 505
504out: 506out:
505 return result; 507 return result;