Skip to content

Commit 15d7518

Browse files
committed
Merge tag 'amd-pstate-v6.11-2024-08-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux
Merge amd-pstate driver fixes for 6.11-rc6 from Mario Limonciello: "amd-pstate fixes for 6.11-rc - Fix to unit test coverage - Fix bug with enabling CPPC on hetero designs - Fix uninitialized variable" * tag 'amd-pstate-v6.11-2024-08-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux: cpufreq/amd-pstate-ut: Don't check for highest perf matching on prefcore cpufreq/amd-pstate: Use topology_logical_package_id() instead of logical_die_id() cpufreq: amd-pstate: Fix uninitialized variable in amd_pstate_cpu_boost_update()
2 parents 5be63fc + 9983a9c commit 15d7518

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

drivers/cpufreq/amd-pstate-ut.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,17 @@ static void amd_pstate_ut_check_perf(u32 index)
160160
lowest_perf = AMD_CPPC_LOWEST_PERF(cap1);
161161
}
162162

163-
if ((highest_perf != READ_ONCE(cpudata->highest_perf)) ||
164-
(nominal_perf != READ_ONCE(cpudata->nominal_perf)) ||
163+
if (highest_perf != READ_ONCE(cpudata->highest_perf) && !cpudata->hw_prefcore) {
164+
pr_err("%s cpu%d highest=%d %d highest perf doesn't match\n",
165+
__func__, cpu, highest_perf, cpudata->highest_perf);
166+
goto skip_test;
167+
}
168+
if ((nominal_perf != READ_ONCE(cpudata->nominal_perf)) ||
165169
(lowest_nonlinear_perf != READ_ONCE(cpudata->lowest_nonlinear_perf)) ||
166170
(lowest_perf != READ_ONCE(cpudata->lowest_perf))) {
167171
amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
168-
pr_err("%s cpu%d highest=%d %d nominal=%d %d lowest_nonlinear=%d %d lowest=%d %d, they should be equal!\n",
169-
__func__, cpu, highest_perf, cpudata->highest_perf,
170-
nominal_perf, cpudata->nominal_perf,
172+
pr_err("%s cpu%d nominal=%d %d lowest_nonlinear=%d %d lowest=%d %d, they should be equal!\n",
173+
__func__, cpu, nominal_perf, cpudata->nominal_perf,
171174
lowest_nonlinear_perf, cpudata->lowest_nonlinear_perf,
172175
lowest_perf, cpudata->lowest_perf);
173176
goto skip_test;

drivers/cpufreq/amd-pstate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static inline int pstate_enable(bool enable)
321321
return 0;
322322

323323
for_each_present_cpu(cpu) {
324-
unsigned long logical_id = topology_logical_die_id(cpu);
324+
unsigned long logical_id = topology_logical_package_id(cpu);
325325

326326
if (test_bit(logical_id, &logical_proc_id_mask))
327327
continue;
@@ -692,7 +692,7 @@ static int amd_pstate_cpu_boost_update(struct cpufreq_policy *policy, bool on)
692692
struct amd_cpudata *cpudata = policy->driver_data;
693693
struct cppc_perf_ctrls perf_ctrls;
694694
u32 highest_perf, nominal_perf, nominal_freq, max_freq;
695-
int ret;
695+
int ret = 0;
696696

697697
highest_perf = READ_ONCE(cpudata->highest_perf);
698698
nominal_perf = READ_ONCE(cpudata->nominal_perf);

0 commit comments

Comments
 (0)