Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
cpufreq/amd-pstate: Add the missing cpufreq_cpu_put()
Browse files Browse the repository at this point in the history
[ Upstream commit 49243ad ]

Fix the reference counting of cpufreq_policy object in amd_pstate_update()
function by adding the missing cpufreq_cpu_put().

Fixes: e8f555d ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dhananjay Ugwekar authored and gregkh committed Sep 30, 2024
1 parent f575a20 commit 76c5106
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/cpufreq/amd-pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 76c5106

Please sign in to comment.