From: Dietmar Eggemann Date: Fri, 21 Jul 2017 10:32:57 +0000 (+0100) Subject: ANDROID: cpufreq: dt: invoke frequency-invariance setter function X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=768aa8c4c5b0f064367d8f33dd1a1a545a180160;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ANDROID: cpufreq: dt: invoke frequency-invariance setter function 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. Cc: Rafael J. Wysocki Cc: Viresh Kumar Signed-off-by: Dietmar Eggemann Change-Id: I00dce40c8def07e87bce7bc556ffc3a8693af038 Signed-off-by: Chris Redpath --- diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index d83ab94d041a..545946ad0752 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -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; } /*