aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Louis Bossart <[email protected]>2022-04-21 15:32:01 -0500
committerMark Brown <[email protected]>2022-04-25 13:58:38 +0100
commitc4eb48f7739fc0dae7e6b8319a77261fc1b61d74 (patch)
tree3c83162a73ba7c3691bd7d9a902ebfb9463c3d3d
parent880924cad12e96092364467cb7b3ad7a689bec55 (diff)
ASoC: SOF: Intel: hda-dai: protect hw_params against successive calls
Once we've set-up the HDA stream and its format, we currently don't support additional format changes. We already have a protection in the .prepare case, but this needs to be added in the hw_params too. In mixing use cases where two DPCM FEs are connected to the same BE, if can happen that there are multiple calls to the BE hw_params when the two FEs are configured simultaneously. This could alternatively be fixed at the DPCM level but that's a more intrusive change requiring infrastructure changes: this would need to be paired with the definition of fixed hw_params at the mixer level. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Reviewed-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/sof/intel/hda-dai.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c
index 53600c6c2911..9823230d2ef4 100644
--- a/sound/soc/sof/intel/hda-dai.c
+++ b/sound/soc/sof/intel/hda-dai.c
@@ -336,8 +336,13 @@ static int hda_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
+ struct hdac_ext_stream *hext_stream =
+ snd_soc_dai_get_dma_data(dai, substream);
int ret;
+ if (hext_stream && hext_stream->link_prepared)
+ return 0;
+
ret = hda_link_dma_hw_params(substream, params);
if (ret < 0)
return ret;