Skip to content

Commit 2db5239

Browse files
committed
soc/intel_adsp: soc_adsp_halt_cpu always fails when NUM_CPUS <= 1
When the target has only a single CPU, this function cannot ever succeed. Skip all of the drama and just return -EINVAL. This makes GCC 14 happy as it doesn't get confused about possible out of bounds access of the soc_cpus_active array. Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent 97f9de1 commit 2db5239

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

soc/intel/intel_adsp/cavs/multiprocessing.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ __imr void soc_mp_init(void)
201201

202202
int soc_adsp_halt_cpu(int id)
203203
{
204+
#if CONFIG_MP_MAX_NUM_CPUS > 1
204205
unsigned int irq_mask;
205206

206207
if (id == 0 || id == arch_curr_cpu()->id) {
@@ -237,4 +238,7 @@ int soc_adsp_halt_cpu(int id)
237238
while ((CAVS_SHIM.pwrsts & CAVS_PWRSTS_PDSPPGS(id))) {
238239
}
239240
return 0;
241+
#else
242+
return -EINVAL;
243+
#endif
240244
}

0 commit comments

Comments
 (0)