From 024f6b83d766c4ad080b38421106067cd4e17d38 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Tue, 15 Oct 2024 23:30:59 +0200 Subject: [PATCH] ipc4: base_fw: Return an empty list for inactive cores The behavior expected by the driver on the host is that if the IPC `IPC4_SCHEDULERS_INFO_GET` is sent for an inactive core, the FW will return success with an empty list in the payload. This patch addresses these shortcomings in the implementation by adding the appropriate IF statement and initializing an empty list regardless of whether something will be added to it later. Signed-off-by: Tomasz Leman --- src/audio/base_fw.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/audio/base_fw.c b/src/audio/base_fw.c index cc86358a32cf..a425e56e180d 100644 --- a/src/audio/base_fw.c +++ b/src/audio/base_fw.c @@ -340,9 +340,6 @@ int schedulers_info_get(uint32_t *data_off_size, if (core_id >= CONFIG_CORE_COUNT) return IPC4_ERROR_INVALID_PARAM; - if (!cpu_is_me(core_id)) - return ipc4_process_on_core(core_id, false); - struct scheduler_props *scheduler_props; /* the internal structs have irregular sizes so we cannot use indexing, and have to * reassign pointers for each element @@ -350,11 +347,16 @@ int schedulers_info_get(uint32_t *data_off_size, struct schedulers_info *schedulers_info = (struct schedulers_info *)data; schedulers_info->scheduler_count = 0; - /* smallest response possible is just zero schedulers count * here we replace max_len from data_off_size to serve as output size */ *data_off_size = sizeof(struct schedulers_info); + /* return empty scheduler_props if core is not active */ + if (!cpu_is_core_enabled(core_id)) + return IPC4_SUCCESS; + + if (!cpu_is_me(core_id)) + return ipc4_process_on_core(core_id, false); /* ===================== LL_TIMER SCHEDULER INFO ============================ */ schedulers_info->scheduler_count++;