soundwire: fix restore_params to recover all buses on prepare failure#5829
Closed
Copilot wants to merge 3 commits into
Closed
soundwire: fix restore_params to recover all buses on prepare failure#5829Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Collaborator
|
Can one of the admins verify this patch?
|
The restore_params block in _sdw_prepare_stream() was restoring only the last bus iterated when an error occurred. For multi-link streams with multiple buses, this left other buses in a partially reconfigured state. Fix this by: 1. Adding bpt_hstop to sdw_bus to track the BPT stream hstop value. 2. Adding saved_params and saved_bpt_hstop to sdw_master_runtime to store per-bus backup state. 3. Pre-saving all buses' params and bpt_hstop before the modify loop. 4. Restoring all buses from their per-bus saved state in restore_params. Addresses review comment: #5604 (comment)
Copilot
AI
changed the title
[WIP] Fix code as per review comment 5604
soundwire: fix restore_params to recover all buses on prepare failure
Jun 26, 2026
Collaborator
|
This looks like a hack. |
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
_sdw_prepare_stream(), therestore_params:error path restores state only for the last bus iterated. In multi-link streams, earlier buses'params(and the newbpt_hstopadded by PR #5604) are left partially modified after failures fromdo_bank_switch()or port-prepare — inconsistent state that affects subsequentcompute_params()calls.Changes
include/linux/soundwire/sdw.h: Addbpt_hstoptosdw_bus— the per-bus column-stop index for the BPT DP0 port referenced by the review comment.drivers/soundwire/bus.h: Addsaved_paramsandsaved_bpt_hstoptosdw_master_runtimefor per-bus backup storage without dynamic allocation.drivers/soundwire/stream.c: Restructure_sdw_prepare_stream()error recovery:stream->master_listbefore any modifications, snapshotting each bus'sparamsandbpt_hstopinto the correspondingm_rt.restore_params:to iterate all masters and restore from per-m_rtsnapshots, ensuring every bus is rolled back regardless of where the failure occurs.