Skip to content

drm: apple: warm-restart the internal 13.5 DCP after a deep sleep - #4411

Open
JJRPF wants to merge 1 commit into
aurora-silicon:mainfrom
JJRPF:fix/dcp-13.5-s2r-warm-restart
Open

JJRPF wants to merge 1 commit into
aurora-silicon:mainfrom
JJRPF:fix/dcp-13.5-s2r-warm-restart

Conversation

@JJRPF

@JJRPF JJRPF commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

What: On T602x with the 13.5 OS firmware stub, the internal DCP has no stop of its own for a deep sleep: dcp_s2r_capable() only covers H17P and 27.x. Its suspend leaves the firmware running, as for s2idle. The sleep's commit then takes the coprocessor down, and at resume dcp_poweron() waits on a dead firmware:

apple-dcp 389c00000.dcp: dcp_poweron() starting
apple-dcp 389c00000.dcp: wait for power timed out, connector will be broken
apple-dcp 389c00000.dcp: set_digital_out_mode timed out

The panel stays off until reboot, and the backlight returns -EIO. This makes the 13.5 firmware do what macOS does. At suspend it puts the AP link to sleep (A500), idles the firmware and stops its CPU with its buffers kept. At resume, before the display subsystem powers the panel on, it power-cycles the coprocessor's block (keeping its DARTs) and warm-restarts the firmware. A sleep refused before the commit gets the same restart: an idled firmware doesn't wake where it is, even with its power kept (IOP power acknowledgment failed: -62 without it). The sequence is the one the earlier T602x S2R work used. It only runs for a non-external DCP on 13.5 firmware in a firmware deep sleep whose commit stops coprocessors, and not on a dry run.

Today nobody hits this on main, because the legacy GPU backend refuses every deep sleep on these Macs. #4313 lets that GPU sleep, so it needs this to land with it or before it; otherwise a J414s on the 13.5 stub wakes to a black screen.

Tested: J414s M2 Pro, OS firmware 13.5 / system firmware 27.2, on aurora/main efef6707019e + #4313, stock command line, internal panel watched each time:

  • 7 deep sleeps (20 s, boot object resumes 0 -> 1 each): panel back with the desktop, brightness keys work. Each time all three 13.5 DCPs (389c00000, 289c00000, 315c00000) logged "idled and stopped" then "warm-restarted", followed by dcp_set_power_state_req returned, 9972 ms remaining and dcp_hotplug() connected:1.
  • One sleep refused before the commit (pm_test=devices, deep): panel back. Before the refused-path change, the same test left it off.
  • Without this change, on the same Mac and the same kernel: black screen after the first deep sleep, as above.

Rebased onto current main (d0684a0604a0), where it compiles cleanly (LLVM, arm64); I haven't booted that exact tree.

Risk: two-way door · only internal DCPs on 13.5 firmware in a firmware deep sleep. On T602x today that is the J414s, once #4313 lets it sleep. #4239 (T6000 J314s) and #4305 (T6001 J316c) add deep sleep to M1 Pro/Max Macs that can also run 13.5 display firmware: if they land, their internal DCP would take this path too, and its power-cycle reads its domains from the DT (resets -> power-domains), skipping the cycle if they can't be mapped. I couldn't test those. No change for 12.3, 14.x, H17P, 27.x, external DCPs or s2idle.

On T602x with the 13.5 OS firmware stub the internal DCP has no stop of
its own for a deep sleep: dcp_s2r_capable() only covers H17P and 27.x.
Its suspend leaves the firmware running as for s2idle, the sleep's commit
then takes the coprocessor down, and at resume dcp_poweron() waits on a
dead firmware:

  apple-dcp 389c00000.dcp: wait for power timed out, connector will be broken
  apple-dcp 389c00000.dcp: set_digital_out_mode timed out

and the panel stays off until reboot.

Do what macOS does on this firmware: put the AP link to sleep (A500),
idle the firmware and stop its CPU with its buffers kept, and at resume,
before the display subsystem powers the panel on, power-cycle the
coprocessor's block and warm-restart the firmware. A sleep refused
before the commit gets the same restart: an idled firmware doesn't wake
where it is, even with its power kept.

Signed-off-by: Justin Pfister <git@jjrpf.com>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CHANGES at 138350b

Failure: The 13.5 link-sleep RPC passes a stack completion to dcp_push and returns after a timeout while the ACK callback can still hold that address. The timeout path resets channel depths only after the completion's stack frame has ended. The ACK handler can also take the callback and cookie before a depth reset. A late ACK can therefore call complete on a dead stack object. Keep the completion valid until the callback is finished or synchronously cancel the callback before returning.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Merge readiness at 138350b2: not ready yet

Check Detail
CI at head running running: host-tests, pr-text / pr-text
Review no needs one approving review from Core, Omarchy Mac or Aurora Maintainers (not the author)
Requested changes no requested by aurora-silicon-review
Hardware row at head no no line with the head SHA 138350b2, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · only internal DCPs on 13.5 firmware in a firmware deep sleep. On T602x today that is the J414s, once #4313 lets it sleep. #4239 (T6000 J314s) and #4305 (T6001 J316c) add deep sleep to M1 Pro/Max Macs that can also run 13.5 display firmware: if they land, their internal DCP would take this path too, and its power-cycle reads its domains from the DT (resets -> power-domains), skipping the cycle if they can't be mapped. I couldn't test those. No change for 12.3, 14.x, H17P, 27.x, external DCPs or s2idle.

Areas: area:display

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant