Skip to content

audio: comp_buffer: make allocations from the passed memory context#10951

Open
serhiy-katsyuba-intel wants to merge 1 commit into
thesofproject:mainfrom
serhiy-katsyuba-intel:userspace_crash_fix2
Open

audio: comp_buffer: make allocations from the passed memory context#10951
serhiy-katsyuba-intel wants to merge 1 commit into
thesofproject:mainfrom
serhiy-katsyuba-intel:userspace_crash_fix2

Conversation

@serhiy-katsyuba-intel

Copy link
Copy Markdown
Contributor

To ensure the buffer is not left outside the module's memory domain, the payload allocation must be made from the supplied context instead of always calling rballoc_align().

This fixes a crash during bind processing when running a test with a userspace DP module on a secondary core.

Copilot AI review requested due to automatic review settings June 22, 2026 14:45
To ensure the buffer is not left outside the module's memory domain, the
payload allocation must be made from the supplied context instead of
always calling rballoc_align().

This fixes a crash during bind processing when running a test with a
userspace DP module on a secondary core.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@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.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Updates buffer payload allocation/freeing to honor the passed mod_alloc_ctx, keeping allocations within the module’s memory domain and avoiding crashes during bind processing (notably with userspace DP modules on secondary cores).

Changes:

  • Switch payload allocation/free paths to prefer sof_ctx_alloc/free when an alloc context is provided, falling back to rballoc_align/rfree otherwise.
  • Replace #ifdef CONFIG_SOF_USERSPACE_LL blocks with runtime selection plus assertions using IS_ENABLED(CONFIG_SOF_USERSPACE_LL).

Comment thread src/audio/buffers/comp_buffer.c
Comment thread src/audio/buffers/comp_buffer.c

@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.

Looks good!

@lgirdwood

Copy link
Copy Markdown
Member

@serhiy-katsyuba-intel can you respond to copilot, thanks !

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