From 2a8c046fadd0ca6604f5b951a1d5669d8742b08a Mon Sep 17 00:00:00 2001 From: Mengdong Lin Date: Tue, 5 Sep 2023 06:16:53 -0400 Subject: [PATCH] zephyr: cpu: only run z_init_cpu() on boot for MTL Only run z_init_cpu() on boot for MTL by replacing the check for IMR_CONTEXT_SAVE with a check for ACE. Therefore, - on MTL, only run z_init_cpu() on boot, not when waking up from D3, regardless whether saving to IMR is enabled or not. - on other platforms, run z_init_cpu() both on boot and on waking up from D3. The difference is caused by differnet Zephyr implementations between MTL and other platforms. Moreover, saving context to IMR is a feature for MTL only, not available for other platorms. Signed-off-by: Mengdong Lin --- zephyr/lib/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/lib/cpu.c b/zephyr/lib/cpu.c index d630177bdde2..bed73e555899 100644 --- a/zephyr/lib/cpu.c +++ b/zephyr/lib/cpu.c @@ -148,7 +148,7 @@ int cpu_enable_core(int id) * initialization. By reinitializing the idle thread, we would overwrite the kernel structs * and the idle thread stack. */ - if (!IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE) || + if (!defined(CONFIG_ACE) || pm_state_next_get(id)->state == PM_STATE_ACTIVE) z_init_cpu(id); #endif