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 0/2] soundwire: Suspend and resume asynchronously
Date: Fri, 27 Nov 2026 16:00:55 +0100 [thread overview]
Message-ID: <20261127150101.48880-1-pmenzel@molgen.mpg.de> (raw)
On system resume, the SoundWire devices are resumed synchronously, so the
codecs on different links wait for each other’s re-enumeration, and the
whole audio subtree waits for every synchronous device before it in
dpm_list. On a Dell XPS 9315 (Alder Lake, SOF, RT1316 on link 2, RT714 on
link 3), the four resume callbacks run one after the other, in one cycle:
soundwire_intel.link.2 2.2 ms
sdw:0:2:025d:1316:01 16.3 ms
soundwire_intel.link.3 2.2 ms
sdw:0:3:025d:0714:01 9.9 ms
Their span is 28.9 ms. With both patches, the callbacks overlap, and the
span drops to 17.1 ms (median of five s2idle cycles each, sleepgraph with
the device callback trace events). It is on the critical path of the resume
with the panel on, right behind SOF, which waits for i915 through its
device link.
Patch 1 marks the generic manager and peripheral devices, patch 2 the Intel
link devices. The SHIM registers are shared by the links; patch 2 explains
why the multi-link SYNC arm and SYNCGO sequence in intel_start_bus()
tolerates two links interleaving. It is the part I am least sure about, so
please check it. The second link’s power-up waits on shim_lock, so in 49 of
50 traced cycles the start-up was serial anyway; in one cycle both links
were armed before the first SYNCGO, and the bus came up fine. If you
prefer, I can serialize intel_start_bus() across links instead; it takes
about 0.1 ms per link.
Not tested: AMD and Qualcomm managers, and peripherals of other codec
drivers. Patch 1 changes the ordering against synchronous devices that are
neither descendants nor device-link consumers of the peripherals. The
WCD93xx codecs have device links. The deferred resume work of the ASoC card
can now run while a codec still waits for its re-initialization; with the
RT1316 and RT715 SDCA drivers, its register writes then end up in the
regmap cache, which the codec syncs afterwards. I checked the other drivers
only by reading the code. Suspend is now asynchronous as well, which I did
not measure.
Tested on the Dell XPS 9315 with 7.4-rc4, these and unrelated resume
patches: 50 s2idle cycles, each followed by 1 s of playback to the RT1316
and 1 s of capture from the RT714 (non-zero samples), with no errors in the
log; also 30 resume stress cycles in an earlier run. The series is based on
soundwire/next and only compile-tested there (W=1).
The analysis, the patches and the messages were drafted with
claude-opus-5-5 (Claude Code), asked to cut the s2idle resume time of the
laptop, see Documentation/process/generated-content.rst.
Paul Menzel (2):
soundwire: Suspend and resume managers and peripherals asynchronously
soundwire: intel: Suspend and resume the links asynchronously
drivers/soundwire/intel_init.c | 3 +++
drivers/soundwire/master.c | 3 +++
drivers/soundwire/slave.c | 6 ++++++
3 files changed, 12 insertions(+)
base-commit: d9ea256ee889f3db9f0bd07ce5d114ce92e31b4f
--
2.54.0
next reply other threads:[~2026-11-27 15:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 15:00 Paul Menzel [this message]
2026-11-27 15:00 ` [PATCH 1/2] soundwire: Suspend and resume managers and peripherals asynchronously Paul Menzel
2026-11-27 15:00 ` [PATCH 2/2] soundwire: intel: Suspend and resume the links asynchronously Paul Menzel
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-1-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®