Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipc4: base_fw: Enable scheduler info retrieval for secondary cores #9511

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tmleman
Copy link
Contributor

@tmleman tmleman commented Sep 25, 2024

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.

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 <[email protected]>
Copy link
Collaborator

@lyakh lyakh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood
Copy link
Member

FYI #5737 (comment)

@lyakh can you expand - for legacy reason we need to reply with IPC4 codes to host, but internally its all posix.

@lyakh
Copy link
Collaborator

lyakh commented Sep 27, 2024

FYI #5737 (comment)

@lyakh can you expand - for legacy reason we need to reply with IPC4 codes to host, but internally its all posix.

base_fw.c has more locations of mixing up the two error code families. The commit in this PR fixes one such case - a pretty harmless one, 0 is the same as IPC4_SUCCESS, but in some locations it mixes up even non-zero return codes, e.g. https://github.com/thesofproject/sof/blob/main/src/audio/base_fw.c#L502 should return POSIX errors, but it calls extended_global_perf_data_get() which returns IPC4 error codes

return IPC4_UNAVAILABLE;
and there are more such examples there. E.g.
int set_perf_meas_state(const char *data)
returns both IPC4_SUCCESS and -EINVAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants