[PATCH 2/2] soundwire: intel: Suspend and resume the links asynchronously

From: Paul Menzel

Date: Fri Nov 27 2026 - 10:04:05 EST


The link devices are auxiliary devices of the audio controller, and without
the async flag the PM core resumes them one after another, and after all
synchronous devices before them in dpm_list. Each link is the parent of its
manager device, so with the async managers and peripherals from the
previous patch, the peripherals on a link still wait for the synchronous
links.

The links share the SHIM registers. Their accesses are serialized by
shim_lock, so link power-up stays sequential. With multi-link
synchronization enabled, intel_start_bus() arms the link in the SYNC
register, initializes the Cadence IP and triggers SYNCGO, which releases
all armed links. If two links interleave there, the first SYNCGO releases
both: a configuration the second link has already written is applied
together with the first one, a later one right away, and the second SYNCGO
finds no armed link. Runtime resume, which goes through the same arm and
SYNCGO sequence, is not serialized across links either.

So enable asynchronous suspend and resume for the link devices too.

On a Dell XPS 9315 (Alder Lake, SOF) with one codec each on links 2 and 3,
the resume callbacks of the links and their codecs now take 17.1 ms instead
of 28.9 ms (median of five s2idle cycles each, both patches). In 49 of 50
traced s2idle cycles, the second link armed 0.06 to 0.32 ms after the first
link’s SYNCGO, because its power-up waits on shim_lock. In one cycle, the
first link’s worker stalled for 0.65 ms after arming (moving from CPU 2 to
CPU 4), so both links wrote CONFIG_UPDATE before the first SYNCGO, and the
two SYNCGO writes followed within 1 us. After each cycle, including that
one, playback to the RT1316 and capture from the RT714 worked.

Signed-off-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
---

Notes:
The analysis (sleepgraph device callback timings, function traces of the
link start-up), the patch and this commit message were drafted with
claude-opus-5-5 (Claude Code), asked to cut the s2idle resume time of
this laptop, see Documentation/process/generated-content.rst. The tests
are in the commit message and the cover letter.

drivers/soundwire/intel_init.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/soundwire/intel_init.c b/drivers/soundwire/intel_init.c
index ad48d67fa9358..7fcfce0d2133b 100644
--- a/drivers/soundwire/intel_init.c
+++ b/drivers/soundwire/intel_init.c
@@ -98,6 +98,9 @@ static struct sdw_intel_link_dev *intel_link_dev_register(struct sdw_intel_res *
return ERR_PTR(ret);
}

+ /* accesses to the shared SHIM registers are serialized by shim_lock */
+ device_enable_async_suspend(&auxdev->dev);
+
ret = auxiliary_device_add(&ldev->auxdev);
if (ret < 0) {
dev_err(res->parent, "failed to add link dev %s link_id %d\n",
--
2.54.0