ipc: ipc-helper: use list_mutex to guard buffer list in userspace LL#10762
Open
kv2019i wants to merge 1 commit into
Open
ipc: ipc-helper: use list_mutex to guard buffer list in userspace LL#10762kv2019i wants to merge 1 commit into
kv2019i wants to merge 1 commit into
Conversation
In user-space LL builds (CONFIG_SOF_USERSPACE_LL), irq_local_disable() is a privileged operation. In ipc_comp_free(), use sys_mutex_lock/unlock on the per-component list_mutex to protect buffer list iteration instead. This follows the same locking pattern as PPL_LOCK/PPL_UNLOCK used in pipeline_disconnect(). Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Collaborator
Author
|
For context, part of #10558 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates ipc_comp_free() to avoid using irq_local_disable() in user-space LL builds (CONFIG_SOF_USERSPACE_LL), where disabling IRQs is a privileged operation, by guarding component buffer-list iteration with the per-component list_mutex instead.
Changes:
- Add a
CONFIG_SOF_USERSPACE_LLconditional path that locks/unlocksicd->cd->list_mutexaround producer/consumer buffer list iteration inipc_comp_free(). - Keep the existing
irq_local_disable()/irq_local_enable()path for non-user-space builds.
Comment on lines
+341
to
+345
| #ifdef CONFIG_SOF_USERSPACE_LL | ||
| sys_mutex_lock(&icd->cd->list_mutex, K_FOREVER); | ||
| #else | ||
| irq_local_disable(flags); | ||
| #endif |
Member
There was a problem hiding this comment.
I wonder if we can just replace irq_local_disable() regardless of user or not.
Comment on lines
+341
to
+343
| #ifdef CONFIG_SOF_USERSPACE_LL | ||
| sys_mutex_lock(&icd->cd->list_mutex, K_FOREVER); | ||
| #else |
lgirdwood
reviewed
May 11, 2026
Member
lgirdwood
left a comment
There was a problem hiding this comment.
I'm good, but just wondered if we should just go full change here and have every config do the same. Not sure if you have already tried.
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 user-space LL builds (CONFIG_SOF_USERSPACE_LL), irq_local_disable() is a privileged operation. In ipc_comp_free(), use sys_mutex_lock/unlock on the per-component list_mutex to protect buffer list iteration instead.
This follows the same locking pattern as PPL_LOCK/PPL_UNLOCK used in pipeline_disconnect().