From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Vinod Koul <vkoul@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: Paul Menzel <pmenzel@molgen.mpg.de>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] soundwire: intel: Suspend and resume the links asynchronously
Date: Fri, 27 Nov 2026 16:00:57 +0100 [thread overview]
Message-ID: <20261127150101.48880-3-pmenzel@molgen.mpg.de> (raw)
In-Reply-To: <20261127150101.48880-1-pmenzel@molgen.mpg.de>
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@molgen.mpg.de>
---
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
prev parent reply other threads:[~2026-11-27 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 15:00 [PATCH 0/2] soundwire: Suspend and resume asynchronously Paul Menzel
2026-11-27 15:00 ` [PATCH 1/2] soundwire: Suspend and resume managers and peripherals asynchronously Paul Menzel
2026-11-27 15:00 ` Paul Menzel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261127150101.48880-3-pmenzel@molgen.mpg.de \
--to=pmenzel@molgen.mpg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=pierre-louis.bossart@linux.dev \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®