summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/scmi-cpufreq.c
diff options
context:
space:
mode:
authorQuentin Perret <quentin.perret@arm.com>2019-01-09 11:42:36 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-01-09 12:10:25 +0100
commit0e141d1c65c1dd31c914eb2e11651adcc1a15912 (patch)
tree65c1cc1116d9f5fc715e51d19998bd1dde5cb106 /drivers/cpufreq/scmi-cpufreq.c
parentcpufreq: check if policy is inactive early in __cpufreq_get() (diff)
downloadlinux-0e141d1c65c1dd31c914eb2e11651adcc1a15912.tar.xz
linux-0e141d1c65c1dd31c914eb2e11651adcc1a15912.zip
cpufreq: scmi: Fix frequency invariance in slow path
The scmi-cpufreq driver calls the arch_set_freq_scale() callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a broken freq_scale factor. Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table. Fixes: 99d6bdf33877 (cpufreq: add support for CPU DVFS based on SCMI message protocol) Signed-off-by: Quentin Perret <quentin.perret@arm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Cc: 4.17+ <stable@vger.kernel.org> # v4.17+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/scmi-cpufreq.c')
-rw-r--r--drivers/cpufreq/scmi-cpufreq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index c2e66528f5ee..242c3370544e 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
int ret;
struct scmi_data *priv = policy->driver_data;
struct scmi_perf_ops *perf_ops = handle->perf_ops;
- u64 freq = policy->freq_table[index].frequency * 1000;
+ u64 freq = policy->freq_table[index].frequency;
- ret = perf_ops->freq_set(handle, priv->domain_id, freq, false);
+ ret = perf_ops->freq_set(handle, priv->domain_id, freq * 1000, false);
if (!ret)
arch_set_freq_scale(policy->related_cpus, freq,
policy->cpuinfo.max_freq);