]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpufreq/amd-pstate: Fix setting EPP in performance mode
authorMario Limonciello (AMD) <superm1@kernel.org>
Sat, 30 May 2026 15:04:34 +0000 (17:04 +0200)
committerMario Limonciello <superm1@kernel.org>
Tue, 2 Jun 2026 17:32:06 +0000 (12:32 -0500)
EPP 0 is the only supported value in the performance policy.
commit 798c47593cca ("cpufreq/amd-pstate: Add support for platform profile
class") changed this while adding platform profile support to the
dynamic EPP feature, but this actually wasn't necessary since platform
profile writes disable manual EPP writes.

Restore allowing writing EPP of 0 when in performance mode.

Reviewed-by: Marco Scardovi <scardracs@disroot.org>
Tested-by: Marco Scardovi <scardracs@disroot.org>
Reported-by: Stuart Meckle <stuartmeckle@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221473
Closes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/work_items/190
Fixes: 798c47593cca ("cpufreq/amd-pstate: Add support for platform profile class")
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
drivers/cpufreq/amd-pstate.c

index 62b5d995281d2984a41e228c14a1c51437efbd48..72df461e7b3974f755a02e9a795c45f894b9986a 100644 (file)
@@ -1428,7 +1428,7 @@ ssize_t store_energy_performance_preference(struct cpufreq_policy *policy,
                        epp = cpudata->epp_default_dc;
        }
 
-       if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) {
+       if (epp > 0 && cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) {
                pr_debug("EPP cannot be set under performance policy\n");
                return -EBUSY;
        }