From: 黄涛 Date: Thu, 28 Feb 2013 05:30:49 +0000 (+0800) Subject: rk: disable preempt_disable when power off X-Git-Tag: firefly_0821_release~7507 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=408e101444abc9c83553244edfa91dc7986cca45;p=firefly-linux-kernel-4.4.55.git rk: disable preempt_disable when power off On power off, pmic driver use mutex, so can not disable preemption. Else will see this bug: rk30_pm_power_off start... act8846_device_shutdown BUG: scheduling while atomic: Thread-102/1505/0x00000002 [] (unwind_backtrace+0x0/0xf8) from [] (__schedule+0x7ec/0x8a8) [] (__schedule+0x7ec/0x8a8) from [] (__mutex_lock_slowpath+0x128/0x1bc) [] (__mutex_lock_slowpath+0x128/0x1bc) from [] (mutex_lock+0x6c/0x70) [] (mutex_lock+0x6c/0x70) from [] (act8846_reg_read+0x28/0x4c) [] (act8846_reg_read+0x28/0x4c) from [] (act8846_device_shutdown+0x24/0x80) [] (act8846_device_shutdown+0x24/0x80) from [] (rk30_pm_power_off+0x4c/0x78) [] (rk30_pm_power_off+0x4c/0x78) from [] (machine_power_off+0x1c/0x24) [] (machine_power_off+0x1c/0x24) from [] (sys_reboot+0x154/0x214) [] (sys_reboot+0x154/0x214) from [] (ret_fast_syscall+0x0/0x30) And smp_send_stop is doing nothing on rk platform when power off, so it is no need to disable preemption. --- diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index c132e8145754..65d27efb1a91 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -279,7 +279,9 @@ void machine_shutdown(void) * thread that might wind up blocking on * one of the stopped CPUs. */ +#ifndef CONFIG_PLAT_RK preempt_disable(); +#endif smp_send_stop(); #endif