]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpufreq/amd-pstate: Move the invocation of amd_pstate_update_perf()
authorDhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
Wed, 4 Dec 2024 14:48:39 +0000 (14:48 +0000)
committerMario Limonciello <mario.limonciello@amd.com>
Wed, 11 Dec 2024 16:44:52 +0000 (10:44 -0600)
amd_pstate_update_perf() should not be a part of shmem_set_epp() function,
so move it to the amd_pstate_epp_update_limit() function, where it is needed.

Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Link: https://lore.kernel.org/r/20241204144842.164178-3-Dhananjay.Ugwekar@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
drivers/cpufreq/amd-pstate.c

index bc42d96984f4c4a8cf36820e6f1a7e57bb255f0e..bd3e0f113a88cba04c5ed246f868d50b2da6fc82 100644 (file)
@@ -296,9 +296,6 @@ static int shmem_set_epp(struct amd_cpudata *cpudata, u32 epp)
        int ret;
        struct cppc_perf_ctrls perf_ctrls;
 
-       amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U,
-                                    cpudata->max_limit_perf, false);
-
        perf_ctrls.energy_perf = epp;
        ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1);
        if (ret) {
@@ -1600,6 +1597,10 @@ static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
                epp = 0;
 
        WRITE_ONCE(cpudata->cppc_req_cached, value);
+
+       amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U,
+                              cpudata->max_limit_perf, false);
+
        return amd_pstate_set_epp(cpudata, epp);
 }