Skip to contentSkip to conversation

cpufreq/amd-pstate: Fix setting EPP in performance mode

PATCH In review Mario Limonciello (AMD) 2 participants 2 messages May 30 – May 31

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq/amd-pstate: Fix setting EPP in performance mode

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.

---
 drivers/cpufreq/amd-pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/amd-pstate.c +1 -1
index 62b5d995281d..72df461e7b39 100644
@@ -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;
 	}
Signature · 1 line
2.54.0
Reviewed-by Tested-by on v1 1/1
#1 lore raw

Re: [PATCH] cpufreq/amd-pstate: Allow EPP to be set to 0 under performance policy

Hi Mario,
as you saw in bugzilla I reached a similar result to yours and in the end I can confirm both work normally so you have my vote for it.

Let me know what do you think about the other patch I posted in
https://bugzilla.kernel.org/show_bug.cgi?id=221473

If you think it's good enough feel free to take it over, I don't mind it as long as it helps.