* [PATCH 1/2] soundwire: Suspend and resume managers and peripherals asynchronously
2026-11-27 15:00 [PATCH 0/2] soundwire: Suspend and resume asynchronously Paul Menzel
@ 2026-11-27 15:00 ` Paul Menzel
2026-11-27 15:00 ` [PATCH 2/2] soundwire: intel: Suspend and resume the links asynchronously Paul Menzel
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Paul Menzel @ 2026-11-27 15:00 UTC (permalink / raw)
To: Vinod Koul, Bard Liao, Pierre-Louis Bossart
Cc: Paul Menzel, linux-sound, linux-kernel
On system resume, the resume callback of a SoundWire peripheral driver
usually waits until the manager has enumerated the peripheral again and the
driver’s update_status callback has re-initialized it. The PM core runs the
callbacks of devices without the async flag one after another in dpm_list
order, so the peripherals on different links wait for each other, and each
of them also waits for all synchronous devices before it in that list.
Apart from the parent-child relation, which the PM core respects for
asynchronous devices, the manager and peripheral devices do not depend on
other devices in the system sleep transitions. Codec drivers that need
their peripherals active, like wcd937x, wcd938x and wcd939x, add device
links, which the PM core respects too. So enable asynchronous suspend and
resume for the managers and the peripherals.
On a Dell XPS 9315 (Alder Lake, SOF), in one cycle, the RT1316 amplifier on
link 2 took 16.3 ms in its resume callback, and the RT714 DMIC codec on
link 3 took 9.9 ms after it. Together with the next patch for the Intel
link devices, the resume callbacks of the two links and the two codecs now
overlap, and their span shrinks from 28.9 ms to 17.1 ms (median of five
s2idle cycles each).
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/master.c | 3 +++
drivers/soundwire/slave.c | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/drivers/soundwire/master.c b/drivers/soundwire/master.c
index 440bfc52ccba5..54ce317ab1628 100644
--- a/drivers/soundwire/master.c
+++ b/drivers/soundwire/master.c
@@ -147,6 +147,9 @@ int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
dev_set_name(&md->dev, "sdw-master-%d-%d", bus->controller_id, bus->link_id);
+ /* the managers of different links can resume in parallel */
+ device_enable_async_suspend(&md->dev);
+
ret = device_register(&md->dev);
if (ret) {
dev_err(parent, "Failed to add master: ret %d\n", ret);
diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c
index a7d2938b031d0..3e77c9c586d17 100644
--- a/drivers/soundwire/slave.c
+++ b/drivers/soundwire/slave.c
@@ -84,6 +84,12 @@ int sdw_slave_add(struct sdw_bus *bus,
sdca_lookup_interface_revision(slave);
sdca_lookup_functions(slave);
+ /*
+ * Peripherals wait for their re-initialization on resume, which can
+ * be done for all of them in parallel.
+ */
+ device_enable_async_suspend(&slave->dev);
+
ret = device_register(&slave->dev);
if (ret) {
dev_err(bus->dev, "Failed to add slave: ret %d\n", ret);
--
2.54.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 2/2] soundwire: intel: Suspend and resume the links asynchronously
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
2026-11-28 11:21 ` [PATCH 0/2] soundwire: Suspend and resume asynchronously Pierre-Louis Bossart
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Paul Menzel @ 2026-11-27 15:00 UTC (permalink / raw)
To: Vinod Koul, Bard Liao, Pierre-Louis Bossart
Cc: Paul Menzel, linux-sound, linux-kernel
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
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] soundwire: Suspend and resume asynchronously
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 ` [PATCH 2/2] soundwire: intel: Suspend and resume the links asynchronously Paul Menzel
@ 2026-11-28 11:21 ` Pierre-Louis Bossart
2026-11-30 11:19 ` Richard Fitzgerald
2026-11-30 11:35 ` Richard Fitzgerald
4 siblings, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2026-11-28 11:21 UTC (permalink / raw)
To: Paul Menzel, Vinod Koul, Bard Liao; +Cc: linux-sound, linux-kernel
On 11/27/26 16:00, Paul Menzel wrote:
> 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 +++
This is a very interesting patchset, thanks for posting this.
I didn't know one could speed-up the suspend-resume time this way.
For managers, I think it's fine, at least on the Intel side I can't
think of any dependencies, and you're correctly pointed out the mutual
exclusion handled with the shim_lock.
> drivers/soundwire/slave.c | 6 ++++++
For peripherals, I would recommend more analysis/measurements - things
are less clear.
Yes in theory all peripherals are independent, but the command/control
channel used for reconfiguring the registers is *serial*. You can really
only send one byte to one peripheral at a given time on the bus - and
there's a msg_lock to that effect.
If you resume multiple peripherals on the same link, the regmap_sync()
may be less efficient with additional overhead due to the mutual exclusion.
It's worse if the devices require firmware download with the BPT
protocol, which is also typically more efficient if only one transfer
takes place for a single resume. IOW serialization of the resume isn't
necessarily a bad idea given the low-level limitations of the bus.
The figures above show the resume time is about an order of magnitude
longer for the peripheral than the manager, so additional data on the
async resume of multiple peripherals on the same link would be very useful.
Do you have access to a platform with multiple amps on the same link?
If not Bard may have some in the Intel CI?
At any rate, I would isolate the change for the peripheral in a
stand-alone patch to allow for easier tests/bisect.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] soundwire: Suspend and resume asynchronously
2026-11-27 15:00 [PATCH 0/2] soundwire: Suspend and resume asynchronously Paul Menzel
` (2 preceding siblings ...)
2026-11-28 11:21 ` [PATCH 0/2] soundwire: Suspend and resume asynchronously Pierre-Louis Bossart
@ 2026-11-30 11:19 ` Richard Fitzgerald
2026-11-30 14:16 ` Pierre-Louis Bossart
2026-11-30 11:35 ` Richard Fitzgerald
4 siblings, 1 reply; 8+ messages in thread
From: Richard Fitzgerald @ 2026-11-30 11:19 UTC (permalink / raw)
To: Paul Menzel, Vinod Koul, Bard Liao, Pierre-Louis Bossart
Cc: linux-sound, linux-kernel, patches
On 27/11/2026 3:00 pm, Paul Menzel wrote:
...
> 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.
I cherry-picked these two patches onto torvalds/master and asked Claude
Opus-5.5 to review them. Here is Claude's review:
HEAD~1 looks safe on 7.4. HEAD carries one real risk: a cross-link race
in the Intel arm/SYNCGO sequence. I found no codec driver whose
suspend/resume relies on synchronous PM, and no deadlocks.
1. HEAD: arm and SYNCGO are not atomic across links (main concern)
• Where: intel_start_bus() arms at intel_bus_common.c:30 and issues
SYNCGO at :41; intel_start_bus_after_reset() does the same at :108 and
:135. Arm and SYNCGO take shim_lock separately, and one SYNCGO clears
the arm bit (CMDSYNC) for every link (intel.c:525).
• Who is affected: with async links, intel_resume() starts every link
concurrently on every resume. multi_link is on by default
(intel_auxdevice.c:407-417), so this covers every Intel system with two
or more links, on both cAVS and ACE2.x.
• Bad ordering: link B arms, link A's SYNCGO clears B's arm, then B
writes the CONFIG_UPDATE that applies its sdw_cdns_init() settings,
which turn on multi-master (MMASTER) mode (cadence_master.c:1481),
without being armed.
• Unarmed CONFIG_UPDATEs are routine once a link is already in MMASTER
mode: exit_reset (cadence_master.c:1182), clock stop (:1737) and clock
restart (:1812).
• The update that first enters MMASTER mode is the one the comment
"follow recommended programming flows to avoid timeouts when gsync is
enabled" protects.
• The commit message says such an update is "applied right away", but
its 50-cycle trace never produced this ordering.
• If it fails: you get "cannot start bus during resume"
(intel_auxdevice.c:754). The link is powered down and runtime PM stays
disabled, because intel_suspend() disabled it (:653) and the re-enable
at :765 is skipped. Every codec on that link then times out until the
driver is rebound.
• Runtime resume: the commit message notes runtime resume isn't
serialized either. That's true, but it needs runtime resumes on two
links to coincide. HEAD makes this concurrency happen on every system
resume.
• Suggested fix: hold a mutex shared by all links of the controller from
arm to SYNCGO in both start_bus variants. Alternatives are to get Intel
to confirm the hardware behaviour, or to drop HEAD; only the combined
gain of both patches was measured.
• Test coverage gaps: ACE2.x, three or more links, and streams
aggregated across links (e.g. amps split over two links).
2. HEAD~1: ordering is preserved
• Async devices still respect parent→child order and device links,
including stateless ones, and every PM phase ends with a barrier.
• The card suspending before its components (and resuming after them)
depends on the card→component link at soc-core.c:1826. That link was
added by 0f54ce994b23 in v7.2. These patches must not be backported
without it.
• If creating that link fails, ASoC only prints a warning. Codecs could
then suspend while streams are still running.
3. Codec drivers
• cs35l56 firmware-idle wait (cs35l56-sdw.c:394-420): still correct.
• The card link means every amp is in PS3 (and has stopped streams)
before any amp's suspend runs.
• The first instance that needs the wait sleeps while holding the mutex,
and the other instances block on it.
• The bus is only reset at resume, which is after the suspend-phase barrier.
• cs35l56 shared RESET: asserted in suspend_late and released in
resume_early, so it depends only on phase barriers, which still hold.
• Other drivers: cs42l43, the SDCA class driver and wcd9378, Realtek,
tas2783, tac5xx2, sn624x, es9356, max98373 and cs42l42 only keep
per-device state. rt1320's BPT firmware transfer is not called from its
PM callbacks.
• Qualcomm and AMD: effectively unaffected.
4. Already present before these commits
• The read-modify-write of the write-1-to-clear WAKESTS register clears
other links' wake bits (intel.c:322, intel_ace2x.c:526).
• Neither platform polls SYNCGO, so the ACE2.x "SyncGO clear failed"
message (intel_ace2x.c:651) is misleading.
• Neither commit message mentions the dependency on 0f54ce994b23.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] soundwire: Suspend and resume asynchronously
2026-11-30 11:19 ` Richard Fitzgerald
@ 2026-11-30 14:16 ` Pierre-Louis Bossart
0 siblings, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2026-11-30 14:16 UTC (permalink / raw)
To: Richard Fitzgerald, Paul Menzel, Vinod Koul, Bard Liao
Cc: linux-sound, linux-kernel, patches
> 1. HEAD: arm and SYNCGO are not atomic across links (main concern)
>
> • Where: intel_start_bus() arms at intel_bus_common.c:30 and issues
> SYNCGO at :41; intel_start_bus_after_reset() does the same at :108
> and :135. Arm and SYNCGO take shim_lock separately, and one SYNCGO
> clears the arm bit (CMDSYNC) for every link (intel.c:525).
> • Who is affected: with async links, intel_resume() starts every link
> concurrently on every resume. multi_link is on by default
> (intel_auxdevice.c:407-417), so this covers every Intel system with two
> or more links, on both cAVS and ACE2.x.
> • Bad ordering: link B arms, link A's SYNCGO clears B's arm, then B
> writes the CONFIG_UPDATE that applies its sdw_cdns_init() settings,
> which turn on multi-master (MMASTER) mode (cadence_master.c:1481),
> without being armed.
> • Unarmed CONFIG_UPDATEs are routine once a link is already in MMASTER
> mode: exit_reset (cadence_master.c:1182), clock stop (:1737) and clock
> restart (:1812).
> • The update that first enters MMASTER mode is the one the comment
> "follow recommended programming flows to avoid timeouts when gsync is
> enabled" protects.
> • The commit message says such an update is "applied right away", but
> its 50-cycle trace never produced this ordering.
> • If it fails: you get "cannot start bus during resume"
> (intel_auxdevice.c:754). The link is powered down and runtime PM stays
> disabled, because intel_suspend() disabled it (:653) and the re-enable
> at :765 is skipped. Every codec on that link then times out until the
> driver is rebound.
> • Runtime resume: the commit message notes runtime resume isn't
> serialized either. That's true, but it needs runtime resumes on two
> links to coincide. HEAD makes this concurrency happen on every system
> resume.
> • Suggested fix: hold a mutex shared by all links of the controller from
> arm to SYNCGO in both start_bus variants. Alternatives are to get Intel
> to confirm the hardware behaviour, or to drop HEAD; only the combined
> gain of both patches was measured.
Both models found the same problem, that's impressive.
I think it's enough to use shim_lock between sync_arm and the end of the
CONFIG_UPDATE. sync_go only happens on a 4kHz basis, no reason to wait
that long.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] soundwire: Suspend and resume asynchronously
2026-11-27 15:00 [PATCH 0/2] soundwire: Suspend and resume asynchronously Paul Menzel
` (3 preceding siblings ...)
2026-11-30 11:19 ` Richard Fitzgerald
@ 2026-11-30 11:35 ` Richard Fitzgerald
2026-11-30 14:12 ` Pierre-Louis Bossart
4 siblings, 1 reply; 8+ messages in thread
From: Richard Fitzgerald @ 2026-11-30 11:35 UTC (permalink / raw)
To: Paul Menzel, Vinod Koul, Bard Liao, Pierre-Louis Bossart
Cc: linux-sound, linux-kernel, patches
On 27/11/2026 3:00 pm, Paul Menzel wrote:
...
> 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.
Codex GPT-Astra-ultra report:
HEAD~1 (9fef13a61342) can cause a same-link resume timeout
Sibling codecs can now start their resume timeouts together. The bus
still initializes one peripheral at a time on each link. It signals
completion only after that peripheral's update_status() returns. A
codec can therefore time out while the bus initializes its siblings.
[1, 2]
Meteor Lake supports four TAS2783 amplifiers on one link. After power
loss, each amp can wait up to three seconds for a firmware download.
Its resume callback allows five seconds for initialization. [3, 4]
In a timing model, each amp takes 1.5 seconds to initialize. With
synchronous callbacks in enumeration order, all four succeed. With
concurrent waits, the fourth amp times out at five seconds and skips
its regcache sync. Its initialization completes at six seconds. The
Dell test had one codec per link, so it could not exercise this case.
I would keep cross-link parallelism and either preserve same-link
ordering for these devices or account for time spent behind siblings
when setting the timeout.
HEAD (2818746b2ca5) leaves one Intel resume ordering untested
Link B can arm and stall before writing CONFIG_UPDATE. Link A can
then issue SYNCGO, clearing B's CMDSYNC. In the overlap reported in
the commit, both links wrote CONFIG_UPDATE before the first SYNCGO.
Intel documents CMDSYNC as holding command execution. Each link also
polls its own CONFIG_UPDATE before issuing a hardware reset. I found
no demonstrated failure from the early SYNCGO. I would test it by
pausing B after it arms and letting A issue SYNCGO. [5, 6]
Child-driver ordering
I found no new deadlock in the drivers reviewed. ASoC normally links
the card to each component. The paired Qualcomm WCD drivers explicitly
order RX and TX. SDCA function devices retain parent-child ordering.
[7, 8]
CS35L56 protects its once-per-suspend firmware delay with a mutex.
It asserts shared RESET in late suspend and releases it in early
resume. The PM phase barriers separate both operations from every
amp's normal register access. [9, 10]
No SoundWire device was available locally. The TAS2783 result comes
from the code and a timing model. Actual amp initialization times and
the Intel early-SYNCGO case remain unverified on hardware.
Source references (paths relative to the kernel tree)
[1] drivers/soundwire/slave.c:91
[2] drivers/soundwire/bus.c:1951, 2014, 2023
[3] sound/soc/intel/common/soc-acpi-intel-mtl-match.c:1077
[4] sound/soc/codecs/tas2783-sdw.c:43, 46, 1137, 1206
[5] drivers/soundwire/intel_bus_common.c:25
[6] Intel Core Processors (Series 3) I/O Registers, document 917383,
SoundWire Link Synchronization (SNDWLSYNC), offset D9C
[7] sound/soc/soc-core.c:1814
[8] sound/soc/codecs/wcd937x.c:2792
[9] sound/soc/codecs/cs35l56-sdw.c:413
[10] sound/soc/codecs/cs35l56.c:1715, 1785
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] soundwire: Suspend and resume asynchronously
2026-11-30 11:35 ` Richard Fitzgerald
@ 2026-11-30 14:12 ` Pierre-Louis Bossart
0 siblings, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2026-11-30 14:12 UTC (permalink / raw)
To: Richard Fitzgerald, Paul Menzel, Vinod Koul, Bard Liao
Cc: linux-sound, linux-kernel, patches
> Codex GPT-Astra-ultra report:
>
> HEAD~1 (9fef13a61342) can cause a same-link resume timeout
>
> Sibling codecs can now start their resume timeouts together. The bus
> still initializes one peripheral at a time on each link. It signals
> completion only after that peripheral's update_status() returns. A
> codec can therefore time out while the bus initializes its siblings.
> [1, 2]
>
> Meteor Lake supports four TAS2783 amplifiers on one link. After power
> loss, each amp can wait up to three seconds for a firmware download.
> Its resume callback allows five seconds for initialization. [3, 4]
>
> In a timing model, each amp takes 1.5 seconds to initialize. With
> synchronous callbacks in enumeration order, all four succeed. With
> concurrent waits, the fourth amp times out at five seconds and skips
> its regcache sync. Its initialization completes at six seconds. The
> Dell test had one codec per link, so it could not exercise this case.
>
> I would keep cross-link parallelism and either preserve same-link
> ordering for these devices or account for time spent behind siblings
> when setting the timeout.
makes sense to me, the enumeration is indeed serialized by construction
and the inits are also done in sequence. Doing a parallel resume does
not bring any benefits given the serial nature of enumeration, init and
command/control.
> HEAD (2818746b2ca5) leaves one Intel resume ordering untested
>
> Link B can arm and stall before writing CONFIG_UPDATE. Link A can
> then issue SYNCGO, clearing B's CMDSYNC. In the overlap reported in
> the commit, both links wrote CONFIG_UPDATE before the first SYNCGO.
>
> Intel documents CMDSYNC as holding command execution. Each link also
> polls its own CONFIG_UPDATE before issuing a hardware reset. I found
> no demonstrated failure from the early SYNCGO. I would test it by
> pausing B after it arms and letting A issue SYNCGO. [5, 6]
I believe the analysis is correct, the sequence 'sync_arm+config update'
should be protected. It's probably a very unlikely issue, given that
sync_go will only happen on a 4kHz frequency and that's more than enough
to write CONFIG_UPDATE.
We should probably follow what's been done for sync_go, i.e. have an
unlocked version and take the shim_lock in intel_bus_common.c.
^ permalink raw reply [flat|nested] 8+ messages in thread