idc: zephyr_idc: check target core before taking idc_mutex#10889
Open
tmleman wants to merge 1 commit into
Open
idc: zephyr_idc: check target core before taking idc_mutex#10889tmleman wants to merge 1 commit into
tmleman wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a mutex leak in the Zephyr IDC implementation: idc_send_msg() could previously lock idc_mutex and then return -EACCES on the disabled-core path without unlocking, blocking subsequent cross-core sends.
Changes:
- Move the
cpu_is_core_enabled(target_cpu)check ahead ofk_mutex_lock()to avoid returning while holdingidc_mutex.
serhiy-katsyuba-intel
approved these changes
Jun 12, 2026
kv2019i
approved these changes
Jun 12, 2026
bd635c6 to
45e1158
Compare
abonislawski
approved these changes
Jun 12, 2026
idc_send_msg() acquired idc_mutex and then returned -EACCES on the disabled-core path without unlocking, leaking the mutex and blocking all later cross-core IDC sends. Move the cpu_is_core_enabled() check ahead of the lock so the early return no longer holds the mutex and the per-core work slot is not touched for a disabled core. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
lgirdwood
approved these changes
Jun 12, 2026
lyakh
approved these changes
Jun 12, 2026
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.
idc_send_msg() acquired idc_mutex and then returned -EACCES on the disabled-core path without unlocking, leaking the mutex and blocking all later cross-core IDC sends.
Move the cpu_is_core_enabled() check ahead of the lock so the early return no longer holds the mutex and the per-core work slot is not touched for a disabled core.