Skip to content

Commit 7eb60bf

Browse files
committed
ipc4: base_fw: Enable scheduler info retrieval for secondary cores
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>
1 parent f2efd4a commit 7eb60bf

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/audio/base_fw.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,14 @@ int schedulers_info_get(uint32_t *data_off_size,
336336
char *data,
337337
uint32_t core_id)
338338
{
339-
/* TODO
340-
* Core id parameter is not yet used. For now we only get scheduler info from current core
341-
* Other cores info can be added by implementing idc request for this data.
342-
* Do this if Schedulers info get ipc has uses for accurate info per core
343-
*/
339+
/* Check if the requested core_id is valid and within the number of configured cores */
340+
if (core_id >= CONFIG_CORE_COUNT) {
341+
return IPC4_ERROR_INVALID_PARAM;
342+
}
343+
344+
if (!cpu_is_me(core_id)) {
345+
return ipc4_process_on_core(core_id, false);
346+
}
344347

345348
struct scheduler_props *scheduler_props;
346349
/* the internal structs have irregular sizes so we cannot use indexing, and have to
@@ -366,7 +369,7 @@ int schedulers_info_get(uint32_t *data_off_size,
366369
scheduler_props = (struct scheduler_props *)(data + *data_off_size);
367370
scheduler_get_task_info_dp(scheduler_props, data_off_size);
368371
#endif
369-
return 0;
372+
return IPC4_SUCCESS;
370373
}
371374

372375
static int basefw_pipeline_list_info_get(uint32_t *data_offset, char *data)

0 commit comments

Comments
 (0)