Skip to content

Commit c4eb48f

Browse files
plbossartbroonie
authored andcommitted
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 <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 880924c commit c4eb48f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

sound/soc/sof/intel/hda-dai.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,13 @@ static int hda_dai_hw_params(struct snd_pcm_substream *substream,
336336
struct snd_pcm_hw_params *params,
337337
struct snd_soc_dai *dai)
338338
{
339+
struct hdac_ext_stream *hext_stream =
340+
snd_soc_dai_get_dma_data(dai, substream);
339341
int ret;
340342

343+
if (hext_stream && hext_stream->link_prepared)
344+
return 0;
345+
341346
ret = hda_link_dma_hw_params(substream, params);
342347
if (ret < 0)
343348
return ret;

0 commit comments

Comments
 (0)