Skip to content

drm/apple: audio: power the DP audio domain for a link held at resume - #1735

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
neosio/dpa-power-on-hold
Nov 12, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
neosio/dpa-power-on-hold

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

On the T8140, a DP audio link held with silence feeds the DisplayPort audio block through SIO DMA channel 102 (DPA1_TX). The block is in dcp-dp-audio's power domain (ps_dpa1), and the held link's runtime-PM reference keeps that domain on.

Since #1681 the sleep's prepare releases a held link, so dcp-dp-audio reaches pm_runtime_force_suspend() with no reference of its own, and pm_runtime_force_resume() leaves it suspended after the wake. The display resumes first and holds the link again in its own resume, before its mode set. dcp-dp-audio's runtime PM is still disabled at that point, so pm_runtime_get_sync() fails, dcpaud_hold_link_locked() carried on anyway, and the SIO fed DPA1 with its domain off. The SIO firmware then crashed on the s2r wake ("Shim DMA unavailable", DPA1_TX), channel 102 never stopped, and sio_suspend_late() refused every later sleep until a reboot. After the crash the link was still held, with audio-controller-1 runtime-suspended and genpd dpa1 off.

Changes:

  • dcp-dp-audio stops and restarts runtime PM in the late and early phases (LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)), so runtime PM works through every device's .suspend and .resume. The display's hold at resume powers the domain the normal way. .prepare and .suspend still quiesce the stream and release a held link, as in drm/apple: audio: suspend an open DP audio stream for system sleep #1681.
  • A link is never held without the runtime-PM reference. When runtime PM was enabled at bind and is off now, a system sleep is in progress: the hold returns -EAGAIN and the display holds the link again at its next mode set.

Tests on the MacBook Neo (aura b12 trial with deep sleep available, integration 53857e6 + this, one boot):

row before (integration) after
s2idle with displays off, displays on, s2r SIO crash in 4 of 6 cycles 5/5, no SIO errors, external display back, dpa1 on after every wake
s2r with a digital-silence stream held on the DP sink 5/5 entered, stream running within 0.5 s of each wake
s2r, displays on 5/5
s2idle, displays on 5/5
s2idle, displays off then on 3/3

No sleep refusals and no AVCs. The link is still held before the mode set after each wake (11 holds, none refused). With #1681 reverted the sequence also passed 5/5, so the crash came from the change in reference counting, not from the SIO.

KUnit: apple-* 315 passed, 1 skipped (existing skip). New case: apple-dcpaud-release-link dcpaud_hold_link_needs_power.

🤖 Generated with Claude Code

On the T8140, a DP audio link held with silence feeds the DisplayPort
audio block through the SIO DMA channel. The block sits in the
dcp-dp-audio device's power domain (ps_dpa1), and the held link's
runtime-PM reference is what keeps that domain on.

Since the sleep's prepare releases a held link, the device has no
reference of its own when it reaches pm_runtime_force_suspend(), so
pm_runtime_force_resume() leaves it suspended after the wake. The
display resumes first and holds the link again in its own resume,
before its mode set. dcp-dp-audio's runtime PM is still disabled then:
pm_runtime_get_sync() fails, dcpaud_hold_link_locked() went on anyway,
and the SIO fed the block with its domain off. The SIO firmware crashed
on the first wake from s2r ("Shim DMA unavailable" on DPA1_TX), the
channel never stopped, and sio_suspend_late() refused every later
sleep until a reboot. After the crash the link was still held with the
device runtime-suspended and the dpa1 domain off.

- Stop and restart runtime PM in the late and early phases, so it works
  through every device's .suspend and .resume, the display's included.
  The display's hold at resume then powers the domain the normal way.
- Never hold a link without the runtime-PM reference. Runtime PM
  enabled at bind and disabled now means a system sleep is in
  progress; the hold fails with -EAGAIN and the display holds the link
  again at its next mode set.

On the MacBook Neo, s2idle with the displays off, displays on, then s2r:
the SIO firmware crashed in 4 of 6 cycles before, 0 of 5 after, with the
external display back and the dpa1 domain on after every wake. Also on
the same boot: s2r 5/5, s2idle 5/5, s2idle with the displays off 3/3,
and s2r 5/5 with a stream of digital silence held on the DP sink (running
again within 0.5 s of every wake). No sleep refusals, SIO errors or
AVCs.

KUnit: apple-dcpaud-release-link gains a case for a hold refused while
runtime PM is off.

Fixes: 327c774 ("drm/apple: audio: suspend an open DP audio stream for system sleep")
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 84e334b into integration/aurora Nov 12, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the neosio/dpa-power-on-hold branch November 12, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant