ASoC: SOF: Intel: hda: fix link DMA config
authorRander Wang <rander.wang@linux.intel.com>
Mon, 22 Jul 2019 14:13:59 +0000 (09:13 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 23 Jul 2019 11:25:22 +0000 (12:25 +0100)
commit934bf82203d679a8f2ff22817e341bc059f5f7fc
treedae03651baa49a52de09a802e54ca03999efeefe
parent7ccafa2b3879612ab9ed88bb6664bd4085957186
ASoC: SOF: Intel: hda: fix link DMA config

For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: https://github.com/thesofproject/sof/issues/1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190722141402.7194-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-dai.c
sound/soc/sof/intel/hda-dsp.c