soundwire: stream: make enable/disable/deprepare idempotent #3097
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.
The stream management currently flags an 'inconsistent state' error
when a change is requested multiple times. This was added on purpose
to identify programming mistakes.
This is however imcompatible with the current ASoC-DPCM
implementation. There is currently no mutual exclusion in
dpcm_be_dai_trigger(), and if two FEs connected to the same BE are
started concurrently the state management the BE may be triggered
twice. The following code shows the state can be tested before being
updated:
This patch suggests allowing the stream functions to be idempotent,
i.e. they can be called multiple times.
Note that the prepare case was already handling multiple calls, this
was added in commit c32464c ("soundwire: stream: only prepare
stream when it is configured.")
FIXME: is this the right fix? Seem like DPCM should not trigger the
same BE twice!
BugLink: thesofproject/sof#4611
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com