]> git.hungrycats.org Git - linux/commitdiff
cpufreq: amd_pstate: fix wrong lowest perf fetch
authorPerry Yuan <Perry.Yuan@amd.com>
Sun, 14 Aug 2022 16:35:45 +0000 (00:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:58:08 +0000 (09:58 +0200)
[ Upstream commit b185c5053c65b7704ead4537e4d4d9b33dc398dc ]

Fix the wrong lowest perf value reading which is used for new
des_perf calculation by governor requested, the incorrect min_perf will
get incorrect des_perf to be set , that will cause the system frequency
changing unexpectedly.

Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
Signed-off-by: Su Jinzhou <jinzhou.su@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/amd-pstate.c

index 365f3ad166a7762370d0d8499750768241368984..d63a28c5f95a9bc5c5ebfa7f4203222dc86d0150 100644 (file)
@@ -322,7 +322,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy,
                return -ENODEV;
 
        cap_perf = READ_ONCE(cpudata->highest_perf);
-       min_perf = READ_ONCE(cpudata->lowest_nonlinear_perf);
+       min_perf = READ_ONCE(cpudata->lowest_perf);
        max_perf = cap_perf;
 
        freqs.old = policy->cur;