Skip to content

Commit a48ac1c

Browse files
qiwuchenvireshk
authored andcommitted
cpufreq: brcmstb-avs: fix imbalance of cpufreq policy refcount
brcm_avs_cpufreq_get() calls cpufreq_cpu_get() to get the cpufreq policy, meanwhile, it also increments the kobject reference count to mark it busy. However, a corresponding call of cpufreq_cpu_put() is ignored to decrement the kobject reference count back, which may lead to a potential stuck risk that the cpuhp thread deadly waits for dropping of kobject refcount when cpufreq policy free. With this patch, the cpuhp thread can be easily exercised by attempting to force an unbind of the CPUfreq driver. Signed-off-by: chenqiwu <[email protected]> [ Viresh: Dropped !policy check ] Signed-off-by: Viresh Kumar <[email protected]>
1 parent 8ead819 commit a48ac1c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/cpufreq/brcmstb-avs-cpufreq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ static unsigned int brcm_avs_cpufreq_get(unsigned int cpu)
455455
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
456456
struct private_data *priv = policy->driver_data;
457457

458+
cpufreq_cpu_put(policy);
459+
458460
return brcm_avs_get_frequency(priv->base);
459461
}
460462

0 commit comments

Comments
 (0)