From: Mario Limonciello Date: Wed, 18 Dec 2024 19:09:55 +0000 (-0600) Subject: cpupower: Don't fetch maximum latency when EPP is enabled X-Git-Tag: v6.14-rc1~148^2^2~1^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=acf71265e4c0289e23ee1b66fc0977478edea9a5;p=thirdparty%2Fkernel%2Flinux.git cpupower: Don't fetch maximum latency when EPP is enabled When EPP has been enabled the hardware will autonomously change frequencies on it's own and thus there is no latency with changing from the kernel. Avoid doing the maximum latency check when EPP is found. This will apply to both amd-pstate and intel-pstate drivers. Link: https://lore.kernel.org/r/20241218191144.3440854-7-superm1@kernel.org Signed-off-by: Mario Limonciello Signed-off-by: Shuah Khan --- diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c index eb9cc0f106342..fc750e127404c 100644 --- a/tools/power/cpupower/utils/cpufreq-info.c +++ b/tools/power/cpupower/utils/cpufreq-info.c @@ -445,6 +445,9 @@ static int get_latency(unsigned int cpu, unsigned int human) { unsigned long latency = cpufreq_get_transition_latency(cpu); + if (!get_epp(cpu, false)) + return -EINVAL; + printf(_(" maximum transition latency: ")); if (!latency || latency == UINT_MAX) { printf(_(" Cannot determine or is not supported.\n"));