From 81908cd36747da5a3c4c649e79decf4facbd6a4e Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 30 Sep 2022 12:23:53 -0700 Subject: [PATCH] soc: intel_adsp/ace: fix CPU halting () The check for whether the CPU is already active before halting was incorrect. It should only fail if the CPU is not active, but the CHECKIF() conditional was inverted. So invert it. () Also need to set the entry in the bookkeeping array to false once a CPU is considered powered down. Signed-off-by: Daniel Leung --- soc/xtensa/intel_adsp/ace/multiprocessing.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/soc/xtensa/intel_adsp/ace/multiprocessing.c b/soc/xtensa/intel_adsp/ace/multiprocessing.c index 599acb7e12a..2b59307c110 100644 --- a/soc/xtensa/intel_adsp/ace/multiprocessing.c +++ b/soc/xtensa/intel_adsp/ace/multiprocessing.c @@ -113,7 +113,7 @@ int soc_adsp_halt_cpu(int id) return -EINVAL; } - CHECKIF(soc_cpus_active[id]) { + CHECKIF(!soc_cpus_active[id]) { return -EINVAL; } @@ -131,5 +131,8 @@ int soc_adsp_halt_cpu(int id) return -EINVAL; } + /* Stop sending IPIs to this core */ + soc_cpus_active[id] = false; + return 0; }