Skip to content

Commit 26e1617

Browse files
superm1shuahkh
authored andcommitted
cpupower: Don't try to read frequency from hardware when kernel uses aperfmperf
When the amd-pstate is in use frequency is set by the hardware and measured by the kernel through using the aperf and mperf registers. There is no direct call to the hardware to indicate current frequency. Detect that this feature is in use and skip the check. Link: https://lore.kernel.org/r/20241218191144.3440854-5-superm1@kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 6d4a298 commit 26e1617

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/power/cpupower/utils/cpufreq-info.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,12 @@ static int get_freq_kernel(unsigned int cpu, unsigned int human)
254254

255255
static int get_freq_hardware(unsigned int cpu, unsigned int human)
256256
{
257-
unsigned long freq = cpufreq_get_freq_hardware(cpu);
257+
unsigned long freq;
258+
259+
if (cpupower_cpu_info.caps & CPUPOWER_CAP_APERF)
260+
return -EINVAL;
261+
262+
freq = cpufreq_get_freq_hardware(cpu);
258263
printf(_(" current CPU frequency: "));
259264
if (!freq) {
260265
printf("Unable to call hardware\n");

0 commit comments

Comments
 (0)