Skip to content

get/set_configuration from DP "application" context - #11199

Merged
kv2019i merged 7 commits into
thesofproject:mainfrom
lyakh:config
Sep 29, 2026
Merged

kv2019i merged 7 commits into
thesofproject:mainfrom
lyakh:config

Conversation

@lyakh

@lyakh lyakh commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Add support for get_configuration() and set_configuration() for DP modules when run by the "application" DP implementation

Make ipc4_process_large_config_get() static, it's only called once in
the same file where it's defined.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Remove "const" from the "param" argument of scheduler_dp_thread_ipc()
- some of the wrapped methods have to modify it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
No need to split module freeing code between module_free() and
module_adapter_free(), merge it back together.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use MAILBOX_HOSTBOX_SIZE to map the mailbox.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Critical configuration dispatch, pointer-type, and allocation-error issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 High severity

Open (3)
What changed in this PR

Adds application-context DP support for module get_configuration()/set_configuration() operations, including IPC, buffering, and memory-allocation updates.

Changes:

  • Adds DP configuration IPC payloads and buffering.
  • Routes configuration and lifecycle operations through the DP scheduler.
  • Updates data-blob allocation contexts and userspace large-config handling.
File Summary
src/​schedule/​zephyr_dp_schedule.h Adds DP configuration buffer state.
src/​schedule/​zephyr_dp_schedule_application.c Implements configuration IPC and buffering; contains pointer-type and allocation-error handling issues.
src/​ipc/​ipc4/​handler-user.c Restricts large-configuration handling to LL userspace.
src/​include/​sof/​schedule/​dp_schedule.h Defines configuration IPC parameters.
src/​include/​sof/​audio/​data_blob.h Updates allocator callback signatures.
src/​include/​ipc4/​handler.h Removes the obsolete handler declaration.
src/​audio/​module_adapter/​module/​generic.c Routes DP lifecycle operations.
src/​audio/​module_adapter/​module_adapter.c Updates DP cleanup handling.
src/​audio/​module_adapter/​module_adapter_ipc4.c Routes large configuration through DP; GET dispatch and return handling require correction.
src/​audio/​data_blob.c Uses module-context allocation and freeing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/audio/module_adapter/module_adapter_ipc4.c Outdated
Comment thread src/schedule/zephyr_dp_schedule_application.c Outdated
Comment thread src/schedule/zephyr_dp_schedule_application.c
With the "application" version of the DP scheduler individual module
adapter methods are offloaded to the userspace thread context. Add
two more methods to the offloaded set: get_configuration() and
set_configuration(). Note, thet get_configuration() also requires
copying data back to the coller, which until now wasn't done.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
It is unclear in which context buffer binding should be executed when
an LL and a DP modules are being bound with both running in userspace
context. Since DP modules have limited visibility into the system and
the userspace LL context on the other hand has access to most DP
assets, perform binding and unbinding in LL thread context. Add
comments to explain that.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
DP modules cannot access the common userspace heap, to fix data blob
allocations for them those allocations have to use sof_ctx_alloc()
and sof_ctx_free() to eventually allocate memory on module accessible
vregion. Note, that we cannot use mod_alloc() and mod_free() because
data-blob allocations are already accounted as module resources, so
doing so would lead to double accounting and eventual double freeing.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One question inline, but not a blocker and rest seems good.

comp_dbg(dev, "start");

#if CONFIG_SOF_USERSPACE_APPLICATION
if (dev->task)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm, this "if (dev->task)" check is removed. On purpose?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@kv2019i yes, the freeing is moved / consolidated above. And there it's guaranteed that it's a DP task. And DP tasks always have their dev->task pointers set. In fact here it was indeed a crude check for a DP task.

@kv2019i
kv2019i merged commit d6cfeaf into thesofproject:main Sep 29, 2026
46 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.

4 participants