]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpufreq/amd-pstate: Allow writes to dynamic_epp when state isn't modified
authorK Prateek Nayak <kprateek.nayak@amd.com>
Fri, 8 May 2026 05:17:45 +0000 (05:17 +0000)
committerMario Limonciello (AMD) <superm1@kernel.org>
Fri, 8 May 2026 05:30:50 +0000 (00:30 -0500)
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@amd.com>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260508051748.10484-4-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
drivers/cpufreq/amd-pstate.c

index 72514be2f30fb9a7675e0aa0d6716f6c69fc4287..462ddad7bc79e5d5ee4e5bb0040c1c78ffe76c24 100644 (file)
@@ -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;