soundwire: only compute port params in specific stream states#5393
Merged
bardliao merged 1 commit intothesofproject:topic/sof-devfrom May 8, 2025
Merged
soundwire: only compute port params in specific stream states#5393bardliao merged 1 commit intothesofproject:topic/sof-devfrom
bardliao merged 1 commit intothesofproject:topic/sof-devfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refines the bandwidth allocation logic by ensuring that only runtime streams in specific states (CONFIGURED, PREPARED, ENABLED, and DISABLED) are processed.
- Introduces a state check before calling sdw_compute_master_ports.
- Limits bandwidth calculation to active stream states.
Comments suppressed due to low confidence (1)
drivers/soundwire/generic_bandwidth_allocation.c:213
- [nitpick] Consider refactoring the state eligibility check into a helper function for improved readability and easier maintenance of allowed states.
if (m_rt->stream->state != SDW_STREAM_CONFIGURED &&
ranj063
reviewed
Apr 28, 2025
37af8df to
542304e
Compare
ranj063
approved these changes
Apr 29, 2025
ujfalusi
reviewed
May 6, 2025
| */ | ||
| if (m_rt->stream->state > SDW_STREAM_DISABLED || | ||
| m_rt->stream->state < SDW_STREAM_CONFIGURED) | ||
| continue; |
Collaborator
There was a problem hiding this comment.
commit message: s/we should not take in count/we should not take into account/
?
Collaborator
Author
There was a problem hiding this comment.
commit message: s/we should not take in count/we should not take into account/ ?
fixed
Currently, sdw_compute_master_ports() is blindly called for every single Manager runtime. However, we should not take into account the stream's bandwidth if the stream is just allocated or already deprepared. Fixes: 25befdf ("soundwire: generic_bandwidth_allocation: count the bandwidth of active streams only") Link: thesofproject#5398 Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
542304e to
6a08906
Compare
ujfalusi
approved these changes
May 8, 2025
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.
Currently, sdw_compute_master_ports() is blindly called for every single Manager runtime. However, we should not take in count the stream's bandwidth if the stream is just allocated or already deprepared.
Fixes: 25befdf ("soundwire: generic_bandwidth_allocation: count the bandwidth of active streams only")