Skip to content

Commit

Permalink
ipc4: base_fw: Enable scheduler info retrieval for secondary cores
Browse files Browse the repository at this point in the history
This commit addresses the limitation in the schedulers_info_get function
where scheduler information could only be retrieved for the primary
core. The updated implementation now validates the core_id against the
number of configured cores (CONFIG_CORE_COUNT) and initiates an IPC
process on the requested core if it is not the current core.

Changes include:
- Adding a check to ensure the core_id is within the valid range.
- Calling ipc4_process_on_core to handle IPC processing on secondary
  cores.
- Returning appropriate IPC4 error codes based on the result of
  ipc4_process_on_core.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
  • Loading branch information
tmleman committed Sep 25, 2024
1 parent f2efd4a commit 7eb60bf
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,14 @@ int schedulers_info_get(uint32_t *data_off_size,
char *data,
uint32_t core_id)
{
/* TODO
* Core id parameter is not yet used. For now we only get scheduler info from current core
* Other cores info can be added by implementing idc request for this data.
* Do this if Schedulers info get ipc has uses for accurate info per core
*/
/* Check if the requested core_id is valid and within the number of configured cores */
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
Expand All @@ -366,7 +369,7 @@ int schedulers_info_get(uint32_t *data_off_size,
scheduler_props = (struct scheduler_props *)(data + *data_off_size);
scheduler_get_task_info_dp(scheduler_props, data_off_size);
#endif
return 0;
return IPC4_SUCCESS;
}

static int basefw_pipeline_list_info_get(uint32_t *data_offset, char *data)
Expand Down

0 comments on commit 7eb60bf

Please sign in to comment.