pm: Do not suspend during kernel initialization

Check if the kernel has fully initialized before take any action that
may suspend the system.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2022-01-18 15:05:54 -08:00 committed by Anas Nashif
parent 669c4d1738
commit bb5d644158

View file

@ -79,7 +79,7 @@ void idle(void *unused1, void *unused2, void *unused3)
* which is essential for the kernel's scheduling
* logic.
*/
if (pm_system_suspend(_kernel.idle) == false) {
if (k_is_pre_kernel() || !pm_system_suspend(_kernel.idle)) {
k_cpu_idle();
}
#else