cpufreq: s3c: fix unbalances of cpufreq policy refcount
authorchenqiwu <chenqiwu@xiaomi.com>
Tue, 7 Jan 2020 07:53:19 +0000 (15:53 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 7 Jan 2020 08:01:01 +0000 (13:31 +0530)
commit8ead819f1befae08182c772b6fdf8ac201b34566
tree0e72eab18e10d35791a36966e8152faaf6149394
parent83fe39ad0a489200d731c78bfdd40e199e5a9cd2
cpufreq: s3c: fix unbalances of cpufreq policy refcount

The cpufreq_reboot_notifier_evt() call cpufreq_cpu_get() to get the
cpufreq policy of cpu0, 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>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/s3c2416-cpufreq.c
drivers/cpufreq/s5pv210-cpufreq.c