Repository navigation
drm/apple: audio: power the DP audio domain for a link held at resume - #1735
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andpm_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, sopm_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, andsio_suspend_late()refused every later sleep until a reboot. After the crash the link was still held, withaudio-controller-1runtime-suspended and genpddpa1off.Changes:
LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)), so runtime PM works through every device's.suspendand.resume. The display's hold at resume powers the domain the normal way..prepareand.suspendstill quiesce the stream and release a held link, as in drm/apple: audio: suspend an open DP audio stream for system sleep #1681.Tests on the MacBook Neo (aura b12 trial with deep sleep available, integration 53857e6 + this, one boot):
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