-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: ipc4: Add support for core_id in create pipeline message #4086
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
ASoC: SOF: ipc4: Add support for core_id in create pipeline message #4086
Conversation
b579303 to
505f946
Compare
|
Changes since v1:
|
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the protection rules are correct.
sound/soc/sof/ipc4-topology.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this rule is correct. It's perfectly fine to have a route between components that are handled by separate pipelines on separate cores. This would only allow for connected pipelines to be on the same core, and that's a short-term limitation we absolutely don't want to upstream.
sound/soc/sof/ipc4-topology.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same on the source side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, so no limitation on the connected pipelines and widgets.
The only limitation is that a widget's core must match with the pipeline's core that it is part of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iow, this is not valid:
if (src_pipeline->core_id != src_widget->core) {
...
}
if (sink_pipeline->core_id != sink_widget->core) {
...
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only limitation is that a widget's core must match with the pipeline's core that it is part of?
Even that part is not clear. When we have DP modules, we will be able to have chained modules on the same pipeline use different cores. So I don't know what the pipeline core would mean, it's an irrelevant notion when DP is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, so if all combinations are fine then what to check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and most importantly, how the DP is going to be used? Is it going to have some mark in tplg?
Without DP we do have limitation, no? We should have the limitation checked now (we don't have DP support afaik) and make it conditional when DP is available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC there is nothing advertized anywhere in kernel-accessible manifests or topology that a module is LL or DP, so it could even be the case that only firmware can check for invalid configurations. @lgirdwood can we have the firmware folks confirm what errors cases we could/need to handled in the driver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, if you send the CREATE_PIPELINE message with core_id=1, the firmware will reply with "invalid core id"
505f946 to
eb1ddfd
Compare
|
Changes since v2:
|
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a comment in the commit message to reflect the direction on error check
Firmware will double-check all information retrieved by topology and report errors if required. This will allow policy and changes in topologies without a need for a synchronized kernel change.
…stored If the pipeline setup fails at the first widget/pipeline then we will have no spipe stored under the pipeline_list->pipelines, the pipeline_list->count is 0. If this is the case we would have a NULL pointer dereference if the execution is allowed to proceed. Check for this condition along with the pipeline_list->pipelines check Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The create pipeline message can carry the target code_id which is set to 0 at the moment. Add macros to set the core_id in the message extension. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Token SOF_TKN_SCHED_CORE in topology file can specify the target core for the pipeline, if it is missing it is going to be 0 (as it is right now). Firmware will double-check all information retrieved by topology and report errors if required. This will allow policy and changes in topologies without a need for a synchronized kernel change. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
eb1ddfd to
3a1a741
Compare
|
Changes since v3:
|
Hi,
the recently merged thesofproject/sof#6637 added support for specifying the target core_id for the pipeline to be created by carving out 4 bits from the reserved section of the message extension.
The core_id can be specified in topology with SOF_TKN_SCHED_CORE token and the kernel will set it to the message.
The core_id will remain 0 (as it is now) when the token is not present and since these bits were ignored, old firmware should with new topology (which is unsupported combination) should not cause regressions, issues either.
replaces PR#4047
Added one new patch to fix a NULL pointer dereference if I force the core_id of the pipelines to 1 which will fail in firmware and the pipeline list allocated, but we have not stored any pipeline in the array, so on stop we are hitting a NULL pointer on the first spipe.