Skip to content

Commit ace9508

Browse files
rafaeljwgregkh
authored andcommitted
cpufreq: intel_pstate: Change intel_pstate_get_hwp_max() argument
commit a45ee4d upstream. All of the callers of intel_pstate_get_hwp_max() access the struct cpudata object that corresponds to the given CPU already and the function itself needs to access that object (in order to update hwp_cap_cached), so modify the code to pass a struct cpudata pointer to it instead of the CPU number. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Chen Yu <yu.c.chen@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b49bee3 commit ace9508

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎drivers/cpufreq/intel_pstate.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,13 @@ static struct freq_attr *hwp_cpufreq_attrs[] = {
829829
NULL,
830830
};
831831

832-
static void intel_pstate_get_hwp_max(unsigned int cpu, int *phy_max,
832+
static void intel_pstate_get_hwp_max(struct cpudata *cpu, int *phy_max,
833833
int *current_max)
834834
{
835835
u64 cap;
836836

837-
rdmsrl_on_cpu(cpu, MSR_HWP_CAPABILITIES, &cap);
838-
WRITE_ONCE(all_cpu_data[cpu]->hwp_cap_cached, cap);
837+
rdmsrl_on_cpu(cpu->cpu, MSR_HWP_CAPABILITIES, &cap);
838+
WRITE_ONCE(cpu->hwp_cap_cached, cap);
839839
if (global.no_turbo || global.turbo_disabled)
840840
*current_max = HWP_GUARANTEED_PERF(cap);
841841
else
@@ -1223,7 +1223,7 @@ static void update_qos_request(enum freq_qos_req_type type)
12231223
continue;
12241224

12251225
if (hwp_active)
1226-
intel_pstate_get_hwp_max(i, &turbo_max, &max_state);
1226+
intel_pstate_get_hwp_max(cpu, &turbo_max, &max_state);
12271227
else
12281228
turbo_max = cpu->pstate.turbo_pstate;
12291229

@@ -1733,7 +1733,7 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)
17331733
if (hwp_active && !hwp_mode_bdw) {
17341734
unsigned int phy_max, current_max;
17351735

1736-
intel_pstate_get_hwp_max(cpu->cpu, &phy_max, &current_max);
1736+
intel_pstate_get_hwp_max(cpu, &phy_max, &current_max);
17371737
cpu->pstate.turbo_freq = phy_max * cpu->pstate.scaling;
17381738
cpu->pstate.turbo_pstate = phy_max;
17391739
} else {
@@ -2217,7 +2217,7 @@ static void intel_pstate_update_perf_limits(struct cpudata *cpu,
22172217
* rather than pure ratios.
22182218
*/
22192219
if (hwp_active) {
2220-
intel_pstate_get_hwp_max(cpu->cpu, &turbo_max, &max_state);
2220+
intel_pstate_get_hwp_max(cpu, &turbo_max, &max_state);
22212221
} else {
22222222
max_state = global.no_turbo || global.turbo_disabled ?
22232223
cpu->pstate.max_pstate : cpu->pstate.turbo_pstate;
@@ -2332,7 +2332,7 @@ static void intel_pstate_verify_cpu_policy(struct cpudata *cpu,
23322332
if (hwp_active) {
23332333
int max_state, turbo_max;
23342334

2335-
intel_pstate_get_hwp_max(cpu->cpu, &turbo_max, &max_state);
2335+
intel_pstate_get_hwp_max(cpu, &turbo_max, &max_state);
23362336
max_freq = max_state * cpu->pstate.scaling;
23372337
} else {
23382338
max_freq = intel_pstate_get_max_freq(cpu);
@@ -2675,7 +2675,7 @@ static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy)
26752675
if (hwp_active) {
26762676
u64 value;
26772677

2678-
intel_pstate_get_hwp_max(policy->cpu, &turbo_max, &max_state);
2678+
intel_pstate_get_hwp_max(cpu, &turbo_max, &max_state);
26792679
policy->transition_delay_us = INTEL_CPUFREQ_TRANSITION_DELAY_HWP;
26802680
rdmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, &value);
26812681
WRITE_ONCE(cpu->hwp_req_cached, value);

0 commit comments

Comments
 (0)