]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregistering
authorPerry Yuan <perry.yuan@amd.com>
Tue, 10 Jan 2023 15:10:29 +0000 (23:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:12 +0000 (11:58 +0100)
commitf35e944d89c8f94330baaecf644b554e4ed00041
tree0c205b71cb9243ea234df0d45e680590f4ff56d9
parent574ff95bb3c803398b829030bd335128e3f0896a
cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregistering

commit db6faf5cc5d979034f5f687393722a9492ab0991 upstream.

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: f77abdff70 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/amd-pstate.c