Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoundWire: stream: improve de-prepare transitions #5177

Closed

Conversation

plbossart
Copy link
Member

Try to address @bardliao's problem on deprepare.

We allocate group->rates and group->lanes in the same routine but only
free the former.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
The existing logic is problematic in that we deprepare all the ports,
but still take into account the stream for bit allocation by just
walking through the bus->m_rt list.

This patch sets the state earlier, so that such DEPREPARED streams can
be skipped in the bandwidth allocation (to be implemented in a
follow-up patch).

Signed-off-by: Pierre-Louis Bossart <[email protected]>
We should not blindly walk through all the m_rt list, since it will
have the side effect of accounting for deprepared streams.

This behavior is the result of the split implementation where the
dailink hw_free() handles the stream state change and the bit
allocation, and the dai hw_free() modifies the m_rt list. The bit
allocation ends-up using m_rt entries in zoombie state, not longer
relevant but still used.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
@bardliao
Copy link
Collaborator

Thanks @plbossart That is clever, and it works on my test. I will merge to my PR.

@plbossart
Copy link
Member Author

thanks for testing @bardliao, I'll close this and let you play with the code in your PR. Feel free to edit/change as needed.

@plbossart plbossart closed this Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants