Repository navigation
Conversation
For some reason only one of the two calls of cdns_init() is error-checked, align error handling for consistency. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
plbossart
requested review from
jack-cy-yu,
oder-chiou and
shumingfan
as code owners
November 30, 2026 15:42
plbossart
force-pushed
the
sdw/sync_arm_unlocked
branch
from
November 30, 2026 15:51
920601d to
bcfca52
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The CNL operations table omits .sync_arm_unlocked, causing multi-link startup and reset-resume to issue CONFIG_UPDATE/SYNCGO without arming CMDSYNC and breaking required synchronization.
1 open issue
What changed in this PR
This PR aims to prevent Intel SoundWire synchronization races by holding the shared shim lock across the sync-arm, configuration-update, and sync-go sequence during startup and reset-resume.
Changes:
- Add an unlocked sync-arm callback and platform helpers.
- Extend locking across the full synchronization sequence.
- Handle initialization failures and release the lock on error paths.
| File | Description |
|---|---|
include/linux/soundwire/sdw_intel.h |
Declare and document the unlocked sync-arm callback. |
drivers/soundwire/intel.h |
Add the callback dispatch wrapper. |
drivers/soundwire/intel.c |
Extract the unlocked legacy Intel sync-arm helper. |
drivers/soundwire/intel_bus_common.c |
Serialize startup and reset-resume synchronization, with error-path unlocks. |
drivers/soundwire/intel_ace2x.c |
Extract and register the unlocked ACE2.x sync-arm helper. |
Review effort: Balanced
bardliao
reviewed
Dec 1, 2026
AI models report a possible race condition when starting multiple links. Add new helper to take lock at a higher level, following the example of sync_go_unlocked. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
AI models expose a possible race condition when starting multiple links in parallel. Link A: Link B: sync_arm sync_arm config_update ... sync_go ... config_update sync_go The sync_go on Link A would clear the CMDSYNC bit for link B, but the config_update has not taken place just yet and the second sync_go would be a no-op - Link B would not start. The suggested fix is to rely on the shim_lock to start each link in a more atomic way. Note that this race condition does not happen during a regular bank switch where the Cadence IP does not need to be configured. It's the sync_arm+config_update that's problematic only on startup/resume. Link: https://lore.kernel.org/linux-sound/0ece6c88-9e3d-4d30-9027-21722bea8754@linux.dev/T/#m74e6c505170df142d8015c93fef1f881e0f5d394 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
plbossart
force-pushed
the
sdw/sync_arm_unlocked
branch
from
December 1, 2026 20:13
bcfca52 to
6225763
Compare
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.

Test PR to try and solve race condition reported on linux-sound, see https://lore.kernel.org/linux-sound/0ece6c88-9e3d-4d30-9027-21722bea8754@linux.dev/T/#e74e6c505170df142d8015c93fef1f881e0f5d394
@bardliao can you review?