Skip to content

Commit d2641a5

Browse files
ionela-voinescurafaeljw
authored andcommitted
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: Ionela Voinescu <ionela.voinescu@arm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Mian Yousaf Kaukab <ykaukab@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent defa0c6 commit d2641a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
150150
unsigned int relation)
151151
{
152152
struct cppc_cpudata *cpu_data = all_cpu_data[policy->cpu];
153+
unsigned int cpu = policy->cpu;
153154
struct cpufreq_freqs freqs;
154155
u32 desired_perf;
155156
int ret = 0;
@@ -164,12 +165,12 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
164165
freqs.new = target_freq;
165166

166167
cpufreq_freq_transition_begin(policy, &freqs);
167-
ret = cppc_set_perf(cpu_data->cpu, &cpu_data->perf_ctrls);
168+
ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls);
168169
cpufreq_freq_transition_end(policy, &freqs, ret != 0);
169170

170171
if (ret)
171172
pr_debug("Failed to set target on CPU:%d. ret:%d\n",
172-
cpu_data->cpu, ret);
173+
cpu, ret);
173174

174175
return ret;
175176
}

0 commit comments

Comments
 (0)