RE: [PATCH 05/21] ASoC: SOF: Intel: hda-sdw-bpt: Stop active DMA before closing BPT streams

From: Liao, Bard

Date: Fri Oct 30 2026 - 09:10:27 EST




> -----Original Message-----
> From: Lee Jones <lee@xxxxxxxxxx>
> Sent: Friday, October 30, 2026 6:47 PM
> To: lee@xxxxxxxxxx; Liam Girdwood <lgirdwood@xxxxxxxxx>; Peter Ujfalusi
> <peter.ujfalusi@xxxxxxxxxxxxxxx>; Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx>;
> Daniel Baluta <daniel.baluta@xxxxxxx>; Kai Vehmanen
> <kai.vehmanen@xxxxxxxxxxxxxxx>; Pierre-Louis Bossart <pierre-
> louis.bossart@xxxxxxxxx>; Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx>;
> Mark Brown <broonie@xxxxxxxxxx>; Jaroslav Kysela <perex@xxxxxxxx>; Takashi
> Iwai <tiwai@xxxxxxxx>; Vinod Koul <vkoul@xxxxxxxxxx>; Ranjani Sridharan
> <ranjani.sridharan@xxxxxxxxxxxxxxx>; sound-open-firmware@xxxxxxxxxxxxxxxx;
> linux-sound@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Cc: stable@xxxxxxxxxxxxxxx
> Subject: [PATCH 05/21] ASoC: SOF: Intel: hda-sdw-bpt: Stop active DMA before
> closing BPT streams
>
> When sdw_enable_stream() fails in intel_ace2x_bpt_send_async() after
> hda_sdw_bpt_send_async() has already started the TX and RX DMA streams,
> intel_ace2x_bpt_close_stream() invokes hda_sdw_bpt_close() directly
> without calling hda_sdw_bpt_wait(). As a result,
> hda_sdw_bpt_dma_deprepare() tears down the DMA buffers and BDL while
> the DMA hardware is still running.
>
> Disable any running TX or RX BPT DMA stream at the start of
> hda_sdw_bpt_close() before unmapping channels and depreparing DMA
> resources.
>
> Fixes: 4c1ce9f37d8a ("soundwire: intel_ace2x: add BPT send_async/wait
> callbacks")
> Closes: https://sashiko.dev/#/bug/linux-ff0012de-abdd-4796-875e-b1fbbf47235f
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
> ---
> sound/soc/sof/intel/hda-sdw-bpt.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/sound/soc/sof/intel/hda-sdw-bpt.c b/sound/soc/sof/intel/hda-sdw-
> bpt.c
> index ba9fbd662b85..9d97d8676251 100644
> --- a/sound/soc/sof/intel/hda-sdw-bpt.c
> +++ b/sound/soc/sof/intel/hda-sdw-bpt.c
> @@ -456,6 +456,12 @@ int hda_sdw_bpt_close(struct device *dev, int link_id,
> struct hdac_ext_stream *b
> int ret;
> int ret1;
>
> + if (bpt_rx_stream && hdac_stream(bpt_rx_stream)->running)

bpt_rx_stream and bpt_tx_stream will never be NULL. The current code
doesn't test it, too.

> + hda_sdw_bpt_dma_disable(dev, bpt_rx_stream);
> +
> + if (bpt_tx_stream && hdac_stream(bpt_tx_stream)->running)
> + hda_sdw_bpt_dma_disable(dev, bpt_tx_stream);
> +
> /*
> * In the case of SoundWire we need to reset the PCMSyCM registers.
> * Need to continue depreparing the DMA buffers even if this fails.
> --
> 2.56.0.317.g454f8302e1-goog
>