Re: [PATCH 0/2] soundwire: Suspend and resume asynchronously

From: Pierre-Louis Bossart

Date: Mon Nov 30 2026 - 09:31:24 EST



> 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.