Skip to content

ASoC/soundwire: Intel: reset the PCMSyCM registers in hda_sdw_bpt_close#5715

Open
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao:reset-PCMSyCM
Open

ASoC/soundwire: Intel: reset the PCMSyCM registers in hda_sdw_bpt_close#5715
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao:reset-PCMSyCM

Conversation

@bardliao
Copy link
Copy Markdown
Collaborator

@bardliao bardliao commented Apr 1, 2026

Resetting the PCMSyCM registers is required for Intel SoundWire stream. The same procedure is done in sdw_hda_dai_hw_params() for the normal SoundWire stream, too.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures Intel SoundWire BPT cleanup resets the PCMSyCM registers on stream close, matching the reset behavior already present for “normal” SoundWire streams.

Changes:

  • Extend hda_sdw_bpt_close() API to accept a link_id.
  • Reset PCMSyCM registers for TX/RX PDIs in hda_sdw_bpt_close().
  • Update in-tree callers to pass the SoundWire instance/link identifier.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
sound/soc/sof/intel/hda-sdw-bpt.c Adds PCMSyCM reset in close path and threads link_id into the close call.
include/sound/hda-sdw-bpt.h Updates the exported/stub prototype for hda_sdw_bpt_close() with link_id.
drivers/soundwire/intel_ace2x.c Updates callers to pass sdw->instance as the link_id argument.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +463 to +470
if (ret)
dev_err(dev, "%s: PCMSyCM PCMSyCM failed for TX: %d\n",
__func__, ret);

ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* cpu_dai->id -> PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret)
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value from hdac_bus_eml_sdw_map_stream_ch() is checked with if (ret) here, but the rest of this file (and e.g. sound/soc/sof/intel/hda-dai.c) consistently treats errors as ret < 0. Please switch to ret < 0 to avoid flagging any non-negative return as an error and to keep error handling consistent.

Suggested change
if (ret)
dev_err(dev, "%s: PCMSyCM PCMSyCM failed for TX: %d\n",
__func__, ret);
ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* cpu_dai->id -> PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret)
if (ret < 0)
dev_err(dev, "%s: PCMSyCM PCMSyCM failed for TX: %d\n",
__func__, ret);
ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* cpu_dai->id -> PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret < 0)

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 7, 2026 13:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ret = hda_sdw_bpt_dma_deprepare(dev, bpt_rx_stream, dmab_rx_bdl);
/*
* In the case of SoundWire we need to reset the PCMSyCM registers.
* Need to continue deprepareing even if this fails.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: “deprepareing” should be corrected (e.g., “depreparing” / “depreparing the DMA buffers”).

Suggested change
* Need to continue deprepareing even if this fails.
* Need to continue depreparing even if this fails.

Copilot uses AI. Check for mistakes.
Comment on lines +467 to +474
dev_err(dev, "%s: hdac_bus_eml_sdw_map_stream_ch failed %d\n",
__func__, ret);

ret1 = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret1 < 0) {
dev_err(dev, "%s: hdac_bus_eml_sdw_map_stream_ch failed %d\n",
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both dev_err() messages are identical for the PDI0/playback and PDI1/capture reset calls, which makes logs ambiguous. Consider including the PDI index and/or direction in the error message so failures can be attributed to the correct stream.

Suggested change
dev_err(dev, "%s: hdac_bus_eml_sdw_map_stream_ch failed %d\n",
__func__, ret);
ret1 = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret1 < 0) {
dev_err(dev, "%s: hdac_bus_eml_sdw_map_stream_ch failed %d\n",
dev_err(dev, "%s: hdac_bus_eml_sdw_map_stream_ch failed for PDI0/playback: %d\n",
__func__, ret);
ret1 = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id,
1, /* PDI1 */
0, 0, SNDRV_PCM_STREAM_CAPTURE);
if (ret1 < 0) {
dev_err(dev, "%s: hdac_bus_eml_sdw_map_stream_ch failed for PDI1/capture: %d\n",

Copilot uses AI. Check for mistakes.
Resetting the PCMSyCM registers is required for Intel SoundWire stream. The
same procedure is done in sdw_hda_dai_hw_params() for the normal
SoundWire stream, too.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants