cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregistering
Subsystems (2)
Perry Yuan
reviewerPATCH v2 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.
--- 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
Rafael J. Wysocki
maintainerQuoted 8 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.
Quoted 5 lines
Acked-by Huang Rui <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Signed-off-by Perry Yuan <[email protected]>Tested-by Wyes Karny <[email protected]>
Can you provide a Fixes tag, please?
Also, what's the difference between this and the previous version?
Quoted 19 lines
--- drivers/cpufreq/amd-pstate.c | 1 + 1 file changed, 1 insertion(+)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) --2.34.1
Yuan, Perry
reviewer[AMD Official Use Only - General]
Hi Rafael:
Quoted 24 lines
-----Original Message-----
From: Rafael J. Wysocki <[email protected]>
Sent: Tuesday, January 10, 2023 8:58 PM
To: Yuan, Perry <[email protected]>
Cc: [email protected]; Limonciello, Mario <[email protected]>; Huang, Ray <[email protected]>; [email protected]; Sharma, Deepak <[email protected]>; Fontenot, Nathan <[email protected]>; Deucher, Alexander <[email protected]>; Huang, Shimmer <[email protected]>; Du, Xiaojian <[email protected]>; Meng, Li (Jassmine) <[email protected]>; Karny, Wyes <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH v2] cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregisteringQuoted 8 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.
Quoted 7 lines
Quoted 5 lines
Acked-by Huang Rui <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Signed-off-by Perry Yuan <[email protected]>Tested-by Wyes Karny <[email protected]>Can you provide a Fixes tag, please?
Sure, let me add the Fixes tag in v3
Quoted 2 lines
Also, what's the difference between this and the previous version?
Just add the "Tested-by: Wyes Karny <[email protected]>" in v2.
Quoted 22 lines
drivers/cpufreq/amd-pstate.c static void amd_pstate_adjust_perf(unsigned int
Quoted 10 lines
--- drivers/cpufreq/amd-pstate.c | 1 + 1 file changed, 1 insertion(+)(quoted diff) +0
-0
b/drivers/cpufreq/amd-pstate.cindex204e39006dda..c17bd845f5fc100644drivers/cpufreq/amd-pstate.c +0
-0@@ -307,6 +307,7 @@ static void amd_pstate_adjust_perf(unsigned intcpu,
Quoted 11 lines
drivers/cpufreq/amd-pstate.c +1
-0max_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)
--
2.34.1