Linux Power Management development
 help / color / mirror / Atom feed
From: Giovanni Gherdovich <ggherdovich@suse.cz>
To: Huang Rui <ray.huang@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Perry Yuan <perry.yuan@amd.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Giovanni Gherdovich <ggherdovich@suse.cz>
Subject: [PATCH] cpufreq/amd-pstate: Supply nominal/lowest freq for TRX40-based motherboards
Date: Wed,  7 Oct 2026 16:41:50 +0200	[thread overview]
Message-ID: <20261007144150.15113-1-ggherdovich@suse.cz> (raw)

Some motherboard based on the TRX40 chipset has been reported to ship
firmware lacking lowest and nominal frequency values in the
_CPC ACPI package. That is, it supports CPPC V2 but not CPPC V3.
Firmware updates aren't available.

amd-pstate requires explicit knowledge of nominal frequency, so it
can't load on this hardware. The driver already has a mechanism (the
so-called "quirks") to accommodate for missing nominal freq in ACPI
tables, so here we use it to match against CPU family, model, core
count, and BIOS version.

Signed-off-by: Giovanni Gherdovich <ggherdovich@suse.cz>
---
 drivers/cpufreq/amd-pstate.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 8bfd46d60843..532ff16dd076 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -145,6 +145,11 @@ static struct quirk_entry quirk_amd_7k62 = {
 	.lowest_freq = 550,
 };
 
+static struct quirk_entry quirk_amd_ryzen_threadripper_3000_24c = {
+	.nominal_freq = 3800,
+	.lowest_freq = 550,
+};
+
 static inline u8 freq_to_perf(union perf_cached perf, u32 nominal_freq, unsigned int freq_val)
 {
 	u32 perf_val = DIV_ROUND_UP_ULL((u64)freq_val * perf.nominal_perf, nominal_freq);
@@ -174,6 +179,22 @@ static int __init dmi_matched_7k62_bios_bug(const struct dmi_system_id *dmi)
 	return 0;
 }
 
+static int __init dmi_matched_trx40_bios_bug(const struct dmi_system_id *dmi)
+{
+	/**
+	 * Match the Ryzen Threadripper 3000 series, 24-core SKU, sTRX4 socket / TRX40 chipset.
+	 */
+	if (boot_cpu_data.x86 == 0x17 &&
+	    boot_cpu_data.x86_model >= 0x30 && boot_cpu_data.x86_model <= 0x3F &&
+	    topology_num_cores_per_package() == 24) {
+		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,
@@ -184,6 +205,16 @@ static const struct dmi_system_id amd_pstate_quirks_table[] __initconst = {
 		},
 		.driver_data = &quirk_amd_7k62,
 	},
+	{
+		.callback = dmi_matched_trx40_bios_bug,
+		.ident = "AMD Ryzen Threadripper 3000",
+		.matches = {
+			DMI_MATCH(DMI_BIOS_VENDOR,  "American Megatrends International"),
+			DMI_MATCH(DMI_BIOS_VERSION, "2.80"),
+			DMI_MATCH(DMI_BIOS_DATE,    "05/17/2022"),
+		},
+		.driver_data = &quirk_amd_ryzen_threadripper_3000_24c,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(dmi, amd_pstate_quirks_table);
-- 
2.43.0


             reply	other threads:[~2026-10-07 14:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 14:41 Giovanni Gherdovich [this message]
2026-10-07 14:56 ` [PATCH] cpufreq/amd-pstate: Supply nominal/lowest freq for TRX40-based motherboards Mario Limonciello
2026-10-07 15:04   ` Kyle Gospodnetich
2026-10-07 15:05     ` Mario Limonciello
2026-10-07 17:36       ` Kyle Gospodnetich
2026-10-07 17:43         ` Kyle Gospodnetich
2026-10-07 18:08           ` Mario Limonciello
2026-10-07 18:30             ` Kyle Gospodnetich
2026-10-07 18:32               ` Mario Limonciello
2026-10-07 18:49                 ` Giovanni Gherdovich
2026-10-07 19:38   ` Giovanni Gherdovich
2026-10-07 19:45     ` Mario Limonciello
2026-10-07 19:59       ` Giovanni Gherdovich
2026-10-08  7:18       ` Giovanni Gherdovich
2026-10-08 12:38         ` Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261007144150.15113-1-ggherdovich@suse.cz \
    --to=ggherdovich@suse.cz \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=perry.yuan@amd.com \
    --cc=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox