aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>2024-08-09 06:08:16 +0000
committerViresh Kumar <viresh.kumar@linaro.org>2024-09-04 20:43:58 +0530
commit49243adc715e6ae34d6cc003827e63bcf5b3a21d (patch)
treea4c88e071d7d5e0d9ee609413530e23e17ae6b2e
parentcpufreq: Drop CONFIG_ARM and CONFIG_ARM64 dependency on Arm drivers (diff)
downloadlinux-rng-49243adc715e6ae34d6cc003827e63bcf5b3a21d.tar.xz
linux-rng-49243adc715e6ae34d6cc003827e63bcf5b3a21d.zip
cpufreq/amd-pstate: Add the missing cpufreq_cpu_put()
Fix the reference counting of cpufreq_policy object in amd_pstate_update() function by adding the missing cpufreq_cpu_put(). Fixes: e8f555daacd3 ("cpufreq/amd-pstate: fix setting policy current frequency value") Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com> Reviewed-by: Perry Yuan <perry.yuan@amd.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rw-r--r--drivers/cpufreq/amd-pstate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 68c616b572f2..eff039ba49ee 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -554,12 +554,15 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
}
if (value == prev)
- return;
+ goto cpufreq_policy_put;
WRITE_ONCE(cpudata->cppc_req_cached, value);
amd_pstate_update_perf(cpudata, min_perf, des_perf,
max_perf, fast_switch);
+
+cpufreq_policy_put:
+ cpufreq_cpu_put(policy);
}
static int amd_pstate_verify(struct cpufreq_policy_data *policy)