mbox series

[SRU,R,0/3] Fix TAS2783 SoundWire amp resume timeout >5s

Message ID 20260825024732.3420898-1-chris.chiu@canonical.com
Headers show
Series Fix TAS2783 SoundWire amp resume timeout >5s | expand

Message

Chris Chiu Aug. 25, 2026, 2:47 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2164967

[Impact]

TAS2783 SoundWire smart amplifiers add >5s to resume on systems with
AMD ACP (e.g., ASUS ProArt PX13, HP EliteBook X G2i). Each TAS2783
device waits up to 5s (TAS2783_PROBE_TIMEOUT) for
slave->initialization_complete during resume. The SoundWire slaves
do not re-enumerate after s2idle on AMD ACP, so the timeout fires
for each device sequentially, causing ~15s slow resume on systems
with 2-3 TAS2783 amps.

After resume, speakers stay silent even though firmware re-downloads
successfully. The regcache holds stale pre-suspend values, so
subsequent read-modify-write updates (DAPM power-up, SDCA PDE
transitions) see "no change" and skip the hardware write. Audio
runs without errors while the amplifier remains muted.

Error log:
  slave-tas2783 sdw:0:1:0102:0000:01:8: resume: initialization timed out
  slave-tas2783 sdw:0:1:0102:0000:01:8: PM: dpm_run_callback(): acpi_subsys_resume returns -110
  slave-tas2783 sdw:0:1:0102:0000:01:8: PM: failed to resume: error -110

[Fix]

Three patches from upstream sound tree:

1. Commit: 0d6b2d6f93a6 ("ASoC: codecs: tas2783-sdw: Propagate
   regcache_sync() errors")
   Upstream: v7.3-rc1

2. Commit: ac6d4f298160 ("ASoC: tas2783: Use new SoundWire
   enumeration helper")
   Upstream: v7.2-rc1

3. Commit: b627da430357 ("ASoC: tas2783-sdw: drop stale regcache
   on uninitialized re-attach")
   Upstream: linux-next / sound-7.3-rc1 (not yet in released tag)
   Fixes: 4cc9bd8d7b32 ("ASoc: tas2783A: Add soundwire based
   codec driver")

[Test Plan]

Suspend 30 times:
  $ sudo rtcwake -m mem -s 20

Without patches: resume takes >5s per TAS2783 device, speakers
produce no audio after resume, dmesg shows "resume: initialization
timed out" and "PM: failed to resume: error -110".

With patches: resume completes in <1s, speakers work after resume,
no timeout errors in dmesg.

[Where problems could occur]

Could break TAS2783 SoundWire driver resume and device initialization.

The sdw_slave_wait_for_init() helper changes how the driver waits
for SoundWire enumeration. If the helper has a bug, resume could
hang or return an error for all SoundWire slaves, not just TAS2783.

The regcache_drop_region() call removes all cached register values.
If the device does not actually lose power during suspend (e.g.,
S3 instead of S0i3), dropping the cache forces a full re-initialization
that is unnecessary and could cause a brief audio glitch on resume.

Andrey Golovko (1):
  ASoC: tas2783-sdw: drop stale regcache on uninitialized re-attach

Charles Keepax (1):
  ASoC: tas2783: Use new SoundWire enumeration helper

Pengpeng Hou (1):
  ASoC: codecs: tas2783-sdw: Propagate regcache_sync() errors

 sound/soc/codecs/tas2783-sdw.c | 42 +++++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 16 deletions(-)

Comments

Rickey Castillo Valenzuela Aug. 26, 2026, 5:43 a.m. UTC | #1
On 8/24/26 20:47, Chris Chiu via kernel-team wrote:
> BugLink: https://bugs.launchpad.net/bugs/2164967
>
> [Impact]
>
> TAS2783 SoundWire smart amplifiers add >5s to resume on systems with
> AMD ACP (e.g., ASUS ProArt PX13, HP EliteBook X G2i). Each TAS2783
> device waits up to 5s (TAS2783_PROBE_TIMEOUT) for
> slave->initialization_complete during resume. The SoundWire slaves
> do not re-enumerate after s2idle on AMD ACP, so the timeout fires
> for each device sequentially, causing ~15s slow resume on systems
> with 2-3 TAS2783 amps.
>
> After resume, speakers stay silent even though firmware re-downloads
> successfully. The regcache holds stale pre-suspend values, so
> subsequent read-modify-write updates (DAPM power-up, SDCA PDE
> transitions) see "no change" and skip the hardware write. Audio
> runs without errors while the amplifier remains muted.
>
> Error log:
>    slave-tas2783 sdw:0:1:0102:0000:01:8: resume: initialization timed out
>    slave-tas2783 sdw:0:1:0102:0000:01:8: PM: dpm_run_callback(): acpi_subsys_resume returns -110
>    slave-tas2783 sdw:0:1:0102:0000:01:8: PM: failed to resume: error -110
>
> [Fix]
>
> Three patches from upstream sound tree:
>
> 1. Commit: 0d6b2d6f93a6 ("ASoC: codecs: tas2783-sdw: Propagate
>     regcache_sync() errors")
>     Upstream: v7.3-rc1
>
> 2. Commit: ac6d4f298160 ("ASoC: tas2783: Use new SoundWire
>     enumeration helper")
>     Upstream: v7.2-rc1
>
> 3. Commit: b627da430357 ("ASoC: tas2783-sdw: drop stale regcache
>     on uninitialized re-attach")
>     Upstream: linux-next / sound-7.3-rc1 (not yet in released tag)
>     Fixes: 4cc9bd8d7b32 ("ASoc: tas2783A: Add soundwire based
>     codec driver")
>
> [Test Plan]
>
> Suspend 30 times:
>    $ sudo rtcwake -m mem -s 20
>
> Without patches: resume takes >5s per TAS2783 device, speakers
> produce no audio after resume, dmesg shows "resume: initialization
> timed out" and "PM: failed to resume: error -110".
>
> With patches: resume completes in <1s, speakers work after resume,
> no timeout errors in dmesg.
>
> [Where problems could occur]
>
> Could break TAS2783 SoundWire driver resume and device initialization.
>
> The sdw_slave_wait_for_init() helper changes how the driver waits
> for SoundWire enumeration. If the helper has a bug, resume could
> hang or return an error for all SoundWire slaves, not just TAS2783.
>
> The regcache_drop_region() call removes all cached register values.
> If the device does not actually lose power during suspend (e.g.,
> S3 instead of S0i3), dropping the cache forces a full re-initialization
> that is unnecessary and could cause a brief audio glitch on resume.
>
> Andrey Golovko (1):
>    ASoC: tas2783-sdw: drop stale regcache on uninitialized re-attach
>
> Charles Keepax (1):
>    ASoC: tas2783: Use new SoundWire enumeration helper
>
> Pengpeng Hou (1):
>    ASoC: codecs: tas2783-sdw: Propagate regcache_sync() errors
>
>   sound/soc/codecs/tas2783-sdw.c | 42 +++++++++++++++++++++-------------
>   1 file changed, 26 insertions(+), 16 deletions(-)
>
Rejected for the following reasons:
- It does not build for amd64


Rickey Castillo