Skip to content

Commit

Permalink
cpufreq: scpi: invoke frequency-invariance setter function
Browse files Browse the repository at this point in the history
Commit 343a8d1 (cpufreq: scpi: remove arm_big_little dependency)
changed the cpufreq driver on juno from arm_big_little to scpi.

The scpi set_target function does not call the frequency-invariance
setter function arch_set_freq_scale() like the arm_big_little set_target
function does. As a result the task scheduler load and utilization
signals are not frequency-invariant on this platform anymore.

Fix this by adding a call to arch_set_freq_scale() into
scpi_cpufreq_set_target().

Fixes: 343a8d1 (cpufreq: scpi: remove arm_big_little dependency)
Signed-off-by: Dietmar Eggemann <[email protected]>
Acked-by: Sudeep Holla <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
deggeman authored and rafaeljw committed Feb 26, 2018
1 parent 91ab883 commit 9326fdf
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/cpufreq/scpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,23 @@ static unsigned int scpi_cpufreq_get_rate(unsigned int cpu)
static int
scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
{
unsigned long freq = policy->freq_table[index].frequency;
struct scpi_data *priv = policy->driver_data;
u64 rate = policy->freq_table[index].frequency * 1000;
u64 rate = freq * 1000;
int ret;

ret = clk_set_rate(priv->clk, rate);
if (!ret && (clk_get_rate(priv->clk) != rate))
ret = -EIO;

return ret;
if (ret)
return ret;

if (clk_get_rate(priv->clk) != rate)
return -EIO;

arch_set_freq_scale(policy->related_cpus, freq,
policy->cpuinfo.max_freq);

return 0;
}

static int
Expand Down

0 comments on commit 9326fdf

Please sign in to comment.