Skip to content

Commit 4f3085f

Browse files
Perry Yuanrafaeljw
authored andcommitted
cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregistering
In the amd_pstate_adjust_perf(), there is one cpufreq_cpu_get() call to increase increments the kobject reference count of policy and make it as busy. Therefore, a corresponding call to cpufreq_cpu_put() is needed to decrement the kobject reference count back, it will resolve the kernel hang issue when unregistering the amd-pstate driver and register the `amd_pstate_epp` driver instance. Fixes: 1d215f0 ("cpufreq: amd-pstate: Add fast switch function for AMD P-State") Acked-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Tested-by: Wyes Karny <wyes.karny@amd.com> Signed-off-by: Perry Yuan <perry.yuan@amd.com> Cc: 5.17+ <stable@vger.kernel.org> # 5.17+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 7e834ff commit 4f3085f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/cpufreq/amd-pstate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
307307
max_perf = min_perf;
308308

309309
amd_pstate_update(cpudata, min_perf, des_perf, max_perf, true);
310+
cpufreq_cpu_put(policy);
310311
}
311312

312313
static int amd_get_min_freq(struct amd_cpudata *cpudata)

0 commit comments

Comments
 (0)