cpufreq: Pass updated policy to driver ->setpolicy() callback
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 Feb 2019 23:26:30 +0000 (00:26 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 20 Feb 2019 09:18:37 +0000 (10:18 +0100)
The invocation of the ->setpolicy() cpufreq driver callback should
be equivalent to calling cpufreq_governor_limits(policy) for drivers
with internal governors, but in fact it isn't so, because the
temporary new_policy object is passed to it instead of the updated
policy.

That is a bit confusing, so make cpufreq_set_policy() pass the
updated policy to the driver ->setpolicy() callback.

No intentional changes of behavior.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq.c

index 06b1a95..0e626b0 100644 (file)
@@ -2286,7 +2286,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
        if (cpufreq_driver->setpolicy) {
                policy->policy = new_policy->policy;
                pr_debug("setting range\n");
-               return cpufreq_driver->setpolicy(new_policy);
+               return cpufreq_driver->setpolicy(policy);
        }
 
        if (new_policy->governor == policy->governor) {