Skip to content

Commit

Permalink
ipc4: base_fw: Return an empty list for inactive cores
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tmleman committed Oct 15, 2024
1 parent 89c0d2b commit 024f6b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,21 +340,23 @@ 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
*/
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++;
Expand Down

0 comments on commit 024f6b8

Please sign in to comment.