[PATCH v2 1/3] cpufreq: amd-pstate: Finalize prefcore before registration
From: Vishal Badole
Date: Wed Nov 25 2026 - 12:21:15 EST
The choice between amd-hfi and preferred-core scheduling applies to the
whole system. However, the HFI check currently runs during per-CPU
initialization and clears the global amd_pstate_prefcore flag.
Move the check to amd_pstate_init(), after preferred-core detection and
before driver registration.
Signed-off-by: Vishal Badole <Vishal.Badole@xxxxxxx>
---
drivers/cpufreq/amd-pstate.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 4bedfbfc18b66..3e0308f644778 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -956,13 +956,6 @@ static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata)
if (!amd_pstate_prefcore)
return;
- /* should use amd-hfi instead */
- if (cpu_feature_enabled(X86_FEATURE_AMD_WORKLOAD_CLASS) &&
- IS_ENABLED(CONFIG_AMD_HFI)) {
- amd_pstate_prefcore = false;
- return;
- }
-
cpudata->hw_prefcore = true;
/* Priorities must be initialized before ITMT support can be toggled on. */
@@ -2438,6 +2431,10 @@ static int __init amd_pstate_init(void)
return ret;
}
+ if (cpu_feature_enabled(X86_FEATURE_AMD_WORKLOAD_CLASS) &&
+ IS_ENABLED(CONFIG_AMD_HFI))
+ amd_pstate_prefcore = false;
+
ret = amd_pstate_register_driver(cppc_state);
if (ret) {
pr_err("failed to register with return %d\n", ret);
--
2.34.1