提交 d2641a5c 编写于 作者: I Ionela Voinescu 提交者: Rafael J. Wysocki

cppc_cpufreq: use policy->cpu as driver of frequency setting

Considering only the currently supported coordination types (ANY, HW,
NONE), this change only makes a difference for the ANY type, when
policy->cpu is hotplugged out. In that case the new policy->cpu will
be different from ((struct cppc_cpudata *)policy->driver_data)->cpu.

While in this case the controls of *ANY* CPU could be used to drive
frequency changes, it's more consistent to use policy->cpu as the
leading CPU, as used in all other cppc_cpufreq functions. Additionally,
the debug prints in cppc_set_perf() would no longer create confusion
when referring to a CPU that is hotplugged out.
Signed-off-by: NIonela Voinescu <ionela.voinescu@arm.com>
Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
Tested-by: NMian Yousaf Kaukab <ykaukab@suse.de>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 defa0c6b
...@@ -150,6 +150,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy, ...@@ -150,6 +150,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
unsigned int relation) unsigned int relation)
{ {
struct cppc_cpudata *cpu_data = all_cpu_data[policy->cpu]; struct cppc_cpudata *cpu_data = all_cpu_data[policy->cpu];
unsigned int cpu = policy->cpu;
struct cpufreq_freqs freqs; struct cpufreq_freqs freqs;
u32 desired_perf; u32 desired_perf;
int ret = 0; int ret = 0;
...@@ -164,12 +165,12 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy, ...@@ -164,12 +165,12 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
freqs.new = target_freq; freqs.new = target_freq;
cpufreq_freq_transition_begin(policy, &freqs); cpufreq_freq_transition_begin(policy, &freqs);
ret = cppc_set_perf(cpu_data->cpu, &cpu_data->perf_ctrls); ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls);
cpufreq_freq_transition_end(policy, &freqs, ret != 0); cpufreq_freq_transition_end(policy, &freqs, ret != 0);
if (ret) if (ret)
pr_debug("Failed to set target on CPU:%d. ret:%d\n", pr_debug("Failed to set target on CPU:%d. ret:%d\n",
cpu_data->cpu, ret); cpu, ret);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册