ASoC: SOF: Intel: hda-dai: reset dma_data and release stream
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 21 Apr 2022 20:31:59 +0000 (15:31 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 25 Apr 2022 12:58:35 +0000 (13:58 +0100)
commit722cbbfaed2a290b1de1fb0ec4ee9a15ec240f7c
treea21488759d7fc521c72ecabeeb2d142c2824d405
parent23b1944e46ab4cd7cbd4ef999f814fc6c6f2eb88
ASoC: SOF: Intel: hda-dai: reset dma_data and release stream

The sequences are missing a call to snd_soc_dai_set_dma_data() when
the stream is cleared, as well as a release of the stream, and tests
to avoid pointer dereferences.

This fixes an underflow issue in a corner case with two streams paused
before a suspend-resume cycle. After resume, the pause_release of the
last stream causes an underflow due to an invalid sequence.

This problem probably existed since the beginning and is only see with
prototypes of a 'deep-buffer' capability, which depends on additional
ASoC fixes, so there's is no Fixes: tag and no real requirement to
backport this patch.

BugLink: https://github.com/thesofproject/linux/issues/3151
Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@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-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-dai.c