]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
cpufreq: tegra: call CPUFREQ_POSTCHANGE notfier in error cases
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 19 Jun 2013 05:48:20 +0000 (11:18 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 24 Jun 2013 12:49:01 +0000 (18:19 +0530)
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.

Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/tegra-cpufreq.c

index c74c0e130ef4b2a16e20a768b05b5946b599a9d6..e74d7774cf1ed965361fcecda005be509c682f59 100644 (file)
@@ -138,12 +138,12 @@ static int tegra_update_cpu_speed(struct cpufreq_policy *policy,
        if (ret) {
                pr_err("cpu-tegra: Failed to set cpu frequency to %d kHz\n",
                        freqs.new);
-               return ret;
+               freqs.new = freqs.old;
        }
 
        cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
 
-       return 0;
+       return ret;
 }
 
 static unsigned long tegra_cpu_highest_speed(void)