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

FIx for DP + multicore with IPC4 #4705

Merged

Conversation

ranj063
Copy link
Collaborator

@ranj063 ranj063 commented Nov 14, 2023

replacement for #4692

@marc-hb
Copy link
Collaborator

marc-hb commented Nov 15, 2023

SOFCI TEST

bardliao
bardliao previously approved these changes Nov 15, 2023
sound/soc/sof/ipc4-topology.c Outdated Show resolved Hide resolved
sound/soc/sof/sof-audio.h Outdated Show resolved Hide resolved
sound/soc/sof/sof-audio.c Outdated Show resolved Hide resolved
@ranj063
Copy link
Collaborator Author

ranj063 commented Nov 15, 2023

SOFCI TEST

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

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

The logic sounds mostly good @ranj063, the only concerns I have are locking and a couple of comment on comments.

sound/soc/sof/ipc4-topology.c Show resolved Hide resolved
sound/soc/sof/ipc4-topology.c Outdated Show resolved Hide resolved
sound/soc/sof/sof-audio.c Show resolved Hide resolved
sound/soc/sof/sof-audio.c Outdated Show resolved Hide resolved
sound/soc/sof/sof-audio.c Outdated Show resolved Hide resolved
sound/soc/sof/sof-audio.c Outdated Show resolved Hide resolved
sound/soc/sof/sof-audio.c Show resolved Hide resolved
ujfalusi
ujfalusi previously approved these changes Nov 16, 2023
int j;

/* decrement ref count for all cores that were updated previously */
for_each_set_bit(j, &spipe->core_mask, sdev->num_cores) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure if it would work, but in theory

for_each_set_bit(j, &spipe->core_mask, i + 1) {

might work as well?

sound/soc/sof/ipc3-topology.c Show resolved Hide resolved
sound/soc/sof/ipc4-topology.c Outdated Show resolved Hide resolved
With IPC4, a pipeline may contain multiple modules in the data
processing domain and they can be scheduled to run on different cores.
Add a new field in struct snd_sof_pipeline to keep track of all the
cores that are associated with the modules in the pipeline. Set the
pipeline core mask for IPC3 when initializing the pipeline widget IPC
structure. For IPC4, set the core mark when initializing the pipeline
widget and initializing processing modules in the data processing domain.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In the current code, we enable a widget core when it is set up and
disable it when it is freed. This is problematic with IPC4 because
widget free is essentially a NOP and all widgets are freed in the
firmware when the pipeline is deleted. This results in a crash during
pipeline deletion when one of it's widgets is scheduled to run on a
secondary core and is powered off when widget is freed. So, change the
logic to enable all cores needed by all the modules in a pipeline when
the pipeline widget is set up and disable them after the pipeline
widget is freed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

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

LGTM @ranj063, just one question below

sound/soc/sof/ipc4-topology.c Show resolved Hide resolved
@plbossart plbossart merged commit 35fe2b4 into thesofproject:topic/sof-dev Nov 20, 2023
12 of 14 checks passed
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.

6 participants