From 2df634b09cdcf84b6ab9ebd3dfe267075a91595b Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Wed, 10 Apr 2024 04:28:56 +0900 Subject: [PATCH] gh-667: Modify message when using amd-pstate-epp (#674) * gh-667: Modify message when using amd-pstate-epp * Address code review * Address code review * nit * Update * fix typo --------- Co-authored-by: shadeyg56 --- auto_cpufreq/core.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/auto_cpufreq/core.py b/auto_cpufreq/core.py index 66e4978a..0f093566 100755 --- a/auto_cpufreq/core.py +++ b/auto_cpufreq/core.py @@ -267,6 +267,7 @@ def turbo(value: bool = None): """ p_state = Path("/sys/devices/system/cpu/intel_pstate/no_turbo") cpufreq = Path("/sys/devices/system/cpu/cpufreq/boost") + amd_pstate = Path("/sys/devices/system/cpu/amd_pstate/status") if p_state.exists(): inverse = True @@ -274,6 +275,12 @@ def turbo(value: bool = None): elif cpufreq.exists(): f = cpufreq inverse = False + elif amd_pstate.exists(): + amd_value = amd_pstate.read_text().strip() + if amd_value == "active": + print("CPU turbo is controlled by amd-pstate-epp driver") + # Basically, no other value should exist. + return False else: print("Warning: CPU turbo is not available") return False