[PATCH 3/6] cpufreq/amd-pstate: Allow writes to dynamic_epp when state isn't modified
From: K Prateek Nayak
Date: Fri May 08 2026 - 01:19:59 EST
Writing the current "dynamic_epp" state to sysfs fails with -EINVAL even
though the desired result was achieved. Allow writes to "dynamic_epp"
that does not modify the state.
Fixes: e30ca6dd5345 ("cpufreq/amd-pstate: Add dynamic energy performance preference")
Reviewed-by: Mario Limonciello <mario.limonciello@xxxxxxx>
Signed-off-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>
---
drivers/cpufreq/amd-pstate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 72514be2f30fb..462ddad7bc79e 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1832,8 +1832,9 @@ static ssize_t dynamic_epp_store(struct device *a, struct device_attribute *b,
return -EINVAL;
}
+ /* Nothing to do */
if (dynamic_epp == enabled)
- return -EINVAL;
+ return count;
/* reinitialize with desired dynamic EPP value */
dynamic_epp = enabled;
--
2.34.1