Skip to content

soundwire: cadence_master: wait and cancel cdns->work before clock stop - #5863

Merged
bardliao merged 1 commit into
thesofproject:topic/sof-devfrom
bardliao:cancel-work-before-clock-stop
Aug 31, 2026
Merged

soundwire: cadence_master: wait and cancel cdns->work before clock stop#5863
bardliao merged 1 commit into
thesofproject:topic/sof-devfrom
bardliao:cancel-work-before-clock-stop

Conversation

@bardliao

Copy link
Copy Markdown
Collaborator

A peripheral event could happen druing the clock stup process. We need to wait for the event be handled before stoping the bus clock. Otherwise, we will get the IO transfer timed out issue.

Fixes: af4cc91 ("soundwire: cadence: mask Slave interrupt before stopping clock")

Copilot AI left a comment

Copy link
Copy Markdown

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 aims to prevent peripheral-event handling from racing with the SoundWire Cadence master clock-stop sequence, which can otherwise lead to IO transfer timeouts during suspend/clock stop.

Changes:

  • Adds a workqueue cancellation/wait step before stopping the bus clock in sdw_cdns_clock_stop().

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

Comment thread drivers/soundwire/cadence_master.c Outdated
Comment on lines +1715 to +1719
/*
* wait for any in-flight peripheral event handling to complete before
* stopping the clock
*/
cancel_work_sync(&cdns->work);
Copilot AI review requested due to automatic review settings July 31, 2026 08:49
@bardliao
bardliao force-pushed the cancel-work-before-clock-stop branch from 800a81e to 32da271 Compare July 31, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread drivers/soundwire/cadence_master.c
A peripheral event could happen druing the clock stop process. We need
to wait for the event be handled before stoping the bus clock.
Otherwise, we will get the IO transfer timed out issue.

Fixes: af4cc91 ("soundwire: cadence: mask Slave interrupt before stopping clock")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao
bardliao force-pushed the cancel-work-before-clock-stop branch from 32da271 to 36fde41 Compare August 31, 2026 05:10

@davidlin923 davidlin923 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

After undergoing 20,000 stress tests on several machines, the function remained normal.

@bardliao
bardliao merged commit 2413ce2 into thesofproject:topic/sof-dev Aug 31, 2026
8 of 9 checks passed
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.

4 participants