From 40bbd6e3adb309d918a20323bea5aa17e6aaca3a Mon Sep 17 00:00:00 2001 From: zhiqiang liang Date: Thu, 13 Dec 2018 16:53:27 +0800 Subject: [PATCH] suspend: power: plug off the secondary cpus for freeze mode [1/1] PD#SWPL-2399 Problem: freeze mode can not kill the secondary cpus Solution: move the cpu kill function before the freeze function Verify: tl1 test success Change-Id: I1da7cb8bcd800b8372fd152490eadd4ef3866ece Signed-off-by: zhiqiang liang --- kernel/power/suspend.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 2d0c99b..678e8fa 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -360,6 +360,25 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) if (suspend_test(TEST_PLATFORM)) goto Platform_wake; +#ifdef CONFIG_AMLOGIC_MODIFY + error = disable_nonboot_cpus(); + if (error || suspend_test(TEST_CPUS)) { + log_suspend_abort_reason("Disabling non-boot cpus failed"); + goto Enable_cpus; + } + /* + * PM_SUSPEND_FREEZE equals + * frozen processes + suspended devices + idle processors. + * Thus we should invoke freeze_enter() soon after + * all the devices are suspended. + */ + if (state == PM_SUSPEND_FREEZE) { + trace_suspend_resume(TPS("machine_suspend"), state, true); + freeze_enter(); + trace_suspend_resume(TPS("machine_suspend"), state, false); + goto Enable_cpus; + } +#else /* * PM_SUSPEND_FREEZE equals * frozen processes + suspended devices + idle processors. @@ -378,6 +397,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) log_suspend_abort_reason("Disabling non-boot cpus failed"); goto Enable_cpus; } +#endif arch_suspend_disable_irqs(); BUG_ON(!irqs_disabled()); -- 2.7.4