pipeline: protect component connections with a mutex#10730
Open
kv2019i wants to merge 1 commit intothesofproject:mainfrom
Open
pipeline: protect component connections with a mutex#10730kv2019i wants to merge 1 commit intothesofproject:mainfrom
kv2019i wants to merge 1 commit intothesofproject:mainfrom
Conversation
Collaborator
Author
|
For context, this is part of #10558 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces mutex-based protection for component buffer connection list updates in userspace LL builds, replacing the previous IRQ-disable critical section in those configurations.
Changes:
- Add a per-component
sys_mutex(userspace LL only) to guard buffer connection lists. - Initialize the new mutex during component initialization for userspace LL builds.
- Use the mutex in
pipeline_connect()/pipeline_disconnect()whenCONFIG_SOF_USERSPACE_LLis enabled; otherwise keep IRQ-disable locking.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/include/sof/audio/component.h |
Adds and initializes a userspace-LL-only mutex in struct comp_dev to protect connection lists. |
src/audio/pipeline/pipeline-graph.c |
Switches connect/disconnect list protection to a mutex in userspace LL builds (IRQ disable otherwise). |
In userspace LL builds, use a mutex to protect component connections. This code should work in kernel builds as well, but start with an incremental change that only affects LL builds, in which mutex use is mandatory. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
12d7962 to
8a60add
Compare
Collaborator
Author
|
V2 pushed:
|
lyakh
reviewed
Apr 29, 2026
| #ifdef CONFIG_SOF_USERSPACE_LL | ||
| #define PPL_LOCK_DECLARE | ||
| #define PPL_LOCK() { int ret = sys_mutex_lock(&comp->list_mutex, K_FOREVER); assert(ret == 0); } | ||
| #define PPL_UNLOCK() { int ret = sys_mutex_unlock(&comp->list_mutex); assert(ret == 0); } |
Collaborator
There was a problem hiding this comment.
can we make these at least do {...} while (0) constructs?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In userspace LL builds, use a mutex to protect component connections. This code should work in kernel builds as well, but start with an incremental change that only affects LL builds, in which mutex use is mandatory.