diff mbox series

[6/7] cpupower: Don't fetch maximum latency when EPP is enabled

Message ID 20241218191144.3440854-7-superm1@kernel.org (mailing list archive)
State Accepted
Delegated to: Shuah Khan
Headers show
Series cpupower improvements on AMD systems | expand

Commit Message

Mario Limonciello Dec. 18, 2024, 7:09 p.m. UTC
From: Mario Limonciello <mario.limonciello@amd.com>

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.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 tools/power/cpupower/utils/cpufreq-info.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

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"));