Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795040669; b=2ZTtCM7DnxbUR2D7lFecKp7/n/BVWTtwPRM+5TxNOPRWtvLgU/rmXRjXLIsMQMfpzq3R ApVgbKbThTNKXV6yaIppHQi0YlIBwYSd5qTV2ztRmJ9MJITJj7x+vLfB0xqwG37+iMKA2 hjc2IcCIme4wEJsngDjwEEaXudGqeS0G8KKdWqSl8BY1p8u0fGbLjwsnIqbwuo6XwLue5 ftp5NCsTtbms7+TRSB6rffF7sep89QlfoFfwlohO4ZRsZ3e9tYG1CM0xHpiR3zwDEL7Xn gSFQThpJpG0eewNlyp7+BFAZf2UOlIdJXQde2VYor3yW8834kKq3yICoqWa1RIat2Ag== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795040669; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=b4ucTtcCQfLzyOnI7GvGEKkTrpaDZY96hT5K1fqLr3U=; b=p7Li/DyCG8Tao2z0i/OiZTv9j+Bp0gs0ArqpjnOtKH53g7+jwTOyFvX9f1F5hcLZ1Xpq lsBRi9GKDX5eZ2DMBHm2mzPOo9K9mmwdgS5gjCIN04XXUxqdivoo2qivqNDFBBcKFX7hY 3Sv434RvGbyqtI3LZ9bzwhpEE3Ncecmv/Gng5Tfl9UBpQxJ+W89Dl88siXSbYuhi0Wahg At99L/T621BWPM/UqAEAEJla5dP10g0ybgnwoOUQ4VizyhIxHRmaMH66MuEACkegDgY12 1OOx2jIlcoIKuS30x7IPbxhj9MrcToGvG7ppwQ8QBaQHA2xS5UZkLsVrhbaCZbouxCw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="AB/B9Usu"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62937606A32F; Wed, 18 Nov 2026 22:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=AB/B9Usu Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E06E1F000C4; Wed, 18 Nov 2026 22:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795040669; bh=b4ucTtcCQfLzyOnI7GvGEKkTrpaDZY96hT5K1fqLr3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AB/B9Usu9Jgl+fTePkbUivOwwporg2erRvaH6b2ama7ahnCwQ1ijkP1Xc5SDZ460F /j/S3o4JNVp1rwZBQS9tWG/Hdm/C4RCIlyJR6W75Z3UwraAgCcB4soMkKRL4+x0QVL iuh21KezeoxnyerCBmhDjn7e/0bi8fysWbZYIfOc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Huang Rui , Mario Limonciello , "Gautham R. Shenoy" , Dhananjay Ugwekar , Perry Yuan , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.6 2500/3318] cpufreq: amd-pstate: Add quirk for the pstate CPPC capabilities missing Date: Wed, 18 Nov 2026 15:52:02 +0100 Message-ID: <20261118150436.387933073@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Perry Yuan [ Upstream commit eb8b6c36820214df96e7e86d8614d93f6b028f28 ] Add quirks table to get CPPC capabilities issue fixed by providing correct perf or frequency values while driver loading. If CPPC capabilities are not defined in the ACPI tables or wrongly defined by platform firmware, it needs to use quick to get those issues fixed with correct workaround values to make pstate driver can be loaded even though there are CPPC capabilities errors. The workaround will match the broken BIOS which lack of CPPC capabilities nominal_freq and lowest_freq definition in the ACPI table. $ cat /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_freq 0 $ cat /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_freq 0 Acked-by: Huang Rui Reviewed-by: Mario Limonciello Reviewed-by: Gautham R. Shenoy Tested-by: Dhananjay Ugwekar Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki Stable-dep-of: f6d3cbc63935 ("cpufreq: amd-pstate: Restore previous mode when changing driver mode fails") Signed-off-by: Sasha Levin --- drivers/cpufreq/amd-pstate.c | 53 ++++++++++++++++++++++++++++++++++-- include/linux/amd-pstate.h | 6 ++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 130e434e8d683..34f330b5ad0de 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -68,6 +68,7 @@ static struct cpufreq_driver amd_pstate_epp_driver; static int cppc_state = AMD_PSTATE_UNDEFINED; static bool cppc_enabled; static bool amd_pstate_prefcore = true; +static struct quirk_entry *quirks; /* * AMD Energy Preference Performance (EPP) @@ -112,6 +113,41 @@ static unsigned int epp_values[] = { typedef int (*cppc_mode_transition_fn)(int); +static struct quirk_entry quirk_amd_7k62 = { + .nominal_freq = 2600, + .lowest_freq = 550, +}; + +static int __init dmi_matched_7k62_bios_bug(const struct dmi_system_id *dmi) +{ + /** + * match the broken bios for family 17h processor support CPPC V2 + * broken BIOS lack of nominal_freq and lowest_freq capabilities + * definition in ACPI tables + */ + if (boot_cpu_has(X86_FEATURE_ZEN2)) { + quirks = dmi->driver_data; + pr_info("Overriding nominal and lowest frequencies for %s\n", dmi->ident); + return 1; + } + + return 0; +} + +static const struct dmi_system_id amd_pstate_quirks_table[] __initconst = { + { + .callback = dmi_matched_7k62_bios_bug, + .ident = "AMD EPYC 7K62", + .matches = { + DMI_MATCH(DMI_BIOS_VERSION, "5.14"), + DMI_MATCH(DMI_BIOS_RELEASE, "12/12/2019"), + }, + .driver_data = &quirk_amd_7k62, + }, + {} +}; +MODULE_DEVICE_TABLE(dmi, amd_pstate_quirks_table); + static inline int get_mode_idx_from_str(const char *str, size_t size) { int i; @@ -819,8 +855,16 @@ static int amd_pstate_init_freq(struct amd_cpudata *cpudata) if (ret) return ret; - min_freq = cppc_perf.lowest_freq * 1000; - nominal_freq = cppc_perf.nominal_freq; + if (quirks && quirks->lowest_freq) + min_freq = quirks->lowest_freq * 1000; + else + min_freq = cppc_perf.lowest_freq * 1000; + + if (quirks && quirks->nominal_freq) + nominal_freq = quirks->nominal_freq ; + else + nominal_freq = cppc_perf.nominal_freq; + nominal_perf = READ_ONCE(cpudata->nominal_perf); highest_perf = READ_ONCE(cpudata->highest_perf); @@ -1688,6 +1732,11 @@ static int __init amd_pstate_init(void) if (cpufreq_get_current_driver()) return -EEXIST; + quirks = NULL; + + /* check if this machine need CPPC quirks */ + dmi_check_system(amd_pstate_quirks_table); + switch (cppc_state) { case AMD_PSTATE_UNDEFINED: /* Disable on the following configs by default: diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index d21838835abda..7b2cbb892fd91 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -124,4 +124,10 @@ static const char * const amd_pstate_mode_string[] = { [AMD_PSTATE_GUIDED] = "guided", NULL, }; + +struct quirk_entry { + u32 nominal_freq; + u32 lowest_freq; +}; + #endif /* _LINUX_AMD_PSTATE_H */ -- 2.53.0