From: Mario Limonciello Date: Mon, 9 Jun 2025 20:05:15 +0000 (-0500) Subject: cpufreq/amd-pstate: Disable preferred cores on designs with workload classification X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfea2b3b4f2346510ec45a0c22450e1564f48f88;p=thirdparty%2Flinux.git cpufreq/amd-pstate: Disable preferred cores on designs with workload classification On designs that have workload classification, it's preferred that the amd-hfi driver is used to provide hints to the scheduler of which cores to use instead of the amd-pstate driver. Signed-off-by: Mario Limonciello Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Gautham R. Shenoy Reviewed-by: Perry Yuan Acked-by: Ilpo Järvinen Link: https://lore.kernel.org/20250609200518.3616080-11-superm1@kernel.org --- diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index f3477ab377425..bbc27ef9edf7b 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -826,6 +826,13 @@ 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. */