cpufreq: dt: invoke frequency-invariance setter function
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Tue, 26 Sep 2017 16:41:09 +0000 (17:41 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 3 Oct 2017 00:37:53 +0000 (02:37 +0200)
Call the frequency-invariance setter function arch_set_freq_scale()
if the new frequency has been successfully set which is indicated by
dev_pm_opp_set_rate() returning 0.

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

index d83ab94d041a89cd35529ac5cb43c542f9282dad..545946ad07527df11459b2d35011774f94f81cac 100644 (file)
@@ -43,9 +43,17 @@ static struct freq_attr *cpufreq_dt_attr[] = {
 static int set_target(struct cpufreq_policy *policy, unsigned int index)
 {
        struct private_data *priv = policy->driver_data;
+       unsigned long freq = policy->freq_table[index].frequency;
+       int ret;
+
+       ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000);
 
-       return dev_pm_opp_set_rate(priv->cpu_dev,
-                                  policy->freq_table[index].frequency * 1000);
+       if (!ret) {
+               arch_set_freq_scale(policy->related_cpus, freq,
+                                   policy->cpuinfo.max_freq);
+       }
+
+       return ret;
 }
 
 /*