author | Tao Zeng <tao.zeng@amlogic.com> | 2019-06-28 07:16:58 (GMT) |
---|---|---|
committer | Shen Liu <shen.liu@amlogic.com> | 2020-03-19 09:55:02 (GMT) |
commit | 2fde10223bbae41b03dabf4719a1e43097cc03b6 (patch) | |
tree | fe227ba844c5ccf207fa21be2f6ba98e08c40982 | |
parent | d0e7e1952c9e8253a76c48007f334fe0453f6fea (diff) | |
download | common-2fde10223bbae41b03dabf4719a1e43097cc03b6.zip common-2fde10223bbae41b03dabf4719a1e43097cc03b6.tar.gz common-2fde10223bbae41b03dabf4719a1e43097cc03b6.tar.bz2 |
cpuhotplug: offline workqueue before close cpu [1/1]
PD#TV-7079
Problem:
Deadlock happened when burning cpu at high temperature.
1486 1916
schedule schedule
schedule_preempt_disabled schedule_timeout
__mutex_lock_slowpath wait_for_common
mutex_lock wait_for_completion
cpu_hotplug_set_max --wait hpg.mutex
cpuhp_kick_ap_work --wait flush work
cpufreq_set_max_cpu_num _cpu_down --hold hpg.mutex
cpucore_set_cur_state do_cpu_down
thermal_cdev_update cpu_down
power_actor_set_power cpu_subsys_offline
power_allocator_throttle device_offline
handle_thermal_trip cpu_hotplug_thread
thermal_zone_device_update kthread
thermal_zone_device_check ret_from_fork
process_one_work
worker_thread --It's a work
kthread
ret_from_fork
Solution:
Close work queue before hold lock
Verify:
T972
Change-Id: I557281a1674bd67472b0655e4f1ba409ffead42f
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
-rw-r--r-- | kernel/cpu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 350ebd8..dd07bf3 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -910,6 +910,10 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen, if (!cpu_present(cpu)) return -EINVAL; +#ifdef CONFIG_AMLOGIC_MODIFY + /* avoid dead lock */ + workqueue_offline_cpu(cpu); +#endif cpu_hotplug_begin(); cpuhp_tasks_frozen = tasks_frozen; |