cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregistering
Subsystems (2)
Perry Yuan
reviewerPATCH v3 1/1 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.
v3: add Fixes tag
v2: add test-by flag from Wyes.
--- drivers/cpufreq/amd-pstate.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/amd-pstate.c +1 -0
@@ -307,6 +307,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu, max_perf = min_perf;amd_pstate_update (cpudata, min_perf, des_perf, max_perf, true); +cpufreq_cpu_put (policy); }static int amd_get_min_freq (struct amd_cpudata *cpudata)
Signature · 1 line
2.34.1
Quoted 26 lines · Perry Yuan
In the
amd_pstate_adjust_perf(), there is onecpufreq_cpu_get()call to increase increments the kobject reference count of policy and make it as busy. Therefore, a corresponding call tocpufreq_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 theamd_pstate_eppdriver instance.Fixes 1d215f0319 ("cpufreq: amd-pstate: Add fast switch function for AMD P-State")Acked-by Huang Rui <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Tested-by Wyes Karny <[email protected]>Signed-off-by Perry Yuan <[email protected]>v3: add Fixes tag
v2: add test-by flag from Wyes.--- drivers/cpufreq/amd-pstate.c | 1 + 1 file changed, 1 insertion(+)drivers/cpufreq/amd-pstate.c +0
-0
drivers/cpufreq/amd-pstate.c static void amd_pstate_adjust_perf(unsigned int cpu,
Quoted 8 lines
drivers/cpufreq/amd-pstate.c +1
-1@@ -307,6 +307,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu, max_perf = min_perf;amd_pstate_update (cpudata, min_perf, des_perf, max_perf, true); +cpufreq_cpu_put (policy); }static int amd_get_min_freq (struct amd_cpudata *cpudata) --
Applied as 6.2-rc material, thanks!