From f07453d14fcab584b94ecd010d6af52ef9c514fa Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Thu, 2 Apr 2026 14:05:22 +0800 Subject: [PATCH] ASoC: SOF: Intel: reset SPIB in hda_data_stream_cleanup The register will indicate to the host DMA where the position is in the buffer currently processed by host SW. Reset it to 0 in hda_data_stream_cleanup. The register is ignored by the host DMA if SPIB is disabled. That's why the "enable" parameter needs to be HDA_DSP_SPIB_ENABLE. Signed-off-by: Bard Liao --- sound/soc/sof/intel/hda-stream.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c index 1c04b5d9c0d8b6..37b310a957970b 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -1326,6 +1326,12 @@ int hda_data_stream_cleanup(struct device *dev, struct snd_dma_buffer *dmab, int sd_offset = SOF_STREAM_SD_OFFSET(hstream); int ret = 0; + /* + * Reset SPIB. The SPIB value will only take effect when SPIB is enabled, + * That's why we need to set the value with HDA_DSP_SPIB_ENABLE + */ + hda_dsp_stream_spib_config(sdev, hext_stream, HDA_DSP_SPIB_ENABLE, 0); + if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) ret = hda_dsp_stream_spib_config(sdev, hext_stream, HDA_DSP_SPIB_DISABLE, 0); else