]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: brcmstb-avs: fix imbalance of cpufreq policy refcount
authorchenqiwu <chenqiwu@xiaomi.com>
Mon, 20 Jan 2020 07:41:28 +0000 (15:41 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 20 Jan 2020 07:53:34 +0000 (13:23 +0530)
commit692f3bed4bb6e122e08fb34dd1ced4f21ffb96ed
treee559f9035cc3279af1a1b0897b15b5bcbe0a35f4
parenta17285b47070f7f9d2bd5593d26bf31c99a5b838
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 <chenqiwu@xiaomi.com>
[ Viresh: Dropped !policy check ]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/brcmstb-avs-cpufreq.c