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 <zhiqiang.liang@amlogic.com>
This commit is contained in:
zhiqiang liang
2018-12-13 16:53:27 +08:00
committed by Luke Go
parent 2d53e35e98
commit d447e8dbeb

View File

@@ -379,6 +379,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.
@@ -397,6 +416,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());