Skip to content

drm/asahi: g17: J716c deep sleep - #2131

Merged
DjDeveloperr merged 4 commits into
integration/aurorafrom
j716c/asahi-sleep
Nov 17, 2026
Merged

DjDeveloperr merged 4 commits into
integration/aurorafrom
j716c/asahi-sleep

Conversation

@erikwb

@erikwb erikwb commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What this does

  • On the T6050, a cancelled sleep step (no firmware resume) keeps the GPU's firmware session owned:
    publication is reopened only once the preparations have drained, nothing powers the GPU down or
    stops its firmware, and a second sleep step while one is in place is refused. Other G17 GPUs keep
    their previous behaviour.
  • The J716c takes the M5 Pro's commit stop (GFX raised out of automatic power before the idle, only
    a GFX that is off is lowered) instead of the generic G17 one, whose mailbox reads could take a
    synchronous external abort in the sleep's last steps.

Tested

  • drm/asahi: g17: J716c deep sleep #2131 (j716c/asahi-sleep) builds on its own base (Image.gz, modules and dtbs, arm64, LLVM).
  • All 17 branches merged on integration/aurora were built as one kernel and run on a J716c (16" M5 Max): one suspend-to-RAM with a USB4 dock attached, about 30 s asleep, woken by the RTC alarm (wake source 76). After the wake all 18 CPUs were online, the dock's router came back in place with its Ethernet up, and the SEP answered RNG reads. The sleep's log showed "secondary clusters down first: cores 6+6, cluster 1 0x1a in 353 us, cluster 2 0x1c01a in 448 us". The PMP was not running in that build.

Dependencies

Branch #2131 (j716c/asahi-sleep). Based on integration/aurora; no dependencies at build time. At run time the J716c deep sleep needs #2119 (j716c/sleep-j716c-profile) and #2123 (j716c/dts-deep-sleep).

Part of the J716c deep sleep set: #2118 (j716c/spin-table-release-cpus), #2119 (j716c/sleep-j716c-profile), #2120 (j716c/sleep-wake-source-names), #2121 (j716c/sleep-sep-auto-wake), #2122 (j716c/sep-t6050-profile), #2123 (j716c/dts-deep-sleep), #2124 (j716c/drm-apple-sleep), #2125 (j716c/dart-sleep), #2126 (j716c/thunderbolt-sleep), #2127 (j716c/usb-sleep), #2128 (j716c/phy-sleep), #2129 (j716c/pcie-sleep), #2130 (j716c/aic-sleep), #2131 (j716c/asahi-sleep), #2132 (j716c/spmi-sleep), #2133 (j716c/macsmc-sleep), #2134 (j716c/nvme-sleep).

🤖 Generated with Claude Code

…0 suspend

On the T6050 the GPU's sleep step only closes publication and waits for
quiet; the firmware is stopped by the sleep's commit. A suspend refused
after that step, with no firmware resume, must not touch that session:
marking it lost or releasing it would let the runtime worker stop the
firmware, or power the GPU down, while the machine never slept.

On the T6050, a cancelled sleep step now keeps the session owned and
only reopens publication once the preparations have drained. A step
that cannot drain, or a crashed GPU, keeps the session as it is with a
warning. A second sleep step while one is still in place is refused,
and a GPU that reports no device or a crash during the step is not
treated as already down. The resume after a suspend that never reached
a firmware resume leaves the session alone.

Other G17 GPUs keep their previous behaviour.

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
On the J716c the GPU took the generic G17 commit stop, which reads the
firmware's mailboxes whatever GFX's power word reads. Between jobs, under
automatic power, that word can read off with the firmware still running,
and the read then takes a synchronous external abort inside the sleep's
last steps.

Take the J714s's M5 stop there too: it raises GFX out of automatic power
before the idle, reports and only lowers a GFX that is off, and leaves the
gating and bridge words alone. The J716c's GPU node has the one power
domain the M5 path resolves (GFX, a PMGR power word) and no PMP request,
so its power word and the PMP request it withdraws are unchanged.

Developed with Claude Code.
Signed-off-by: Erik Bourget <erik@ebourget.net>
…drain

An invalidated preparation can still be outstanding when a precommit
cancel reaches its bounded drain limit. Arrange a software-only poll
retry so the retained session can reopen publication after the last
invalidated lease drains. Keep publication closed on failure, removal,
an armed commit, or expiration of the bounded retry.

Signed-off-by: Diljit Singh <hey@djdev.me>
Retain the tested production changes and use the ext26 cold-boot
fixture revision that landed in integration.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 17, 2026 19:40
@DjDeveloperr
DjDeveloperr merged commit e2c138f into integration/aurora Nov 17, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the j716c/asahi-sleep branch November 17, 2026 23:52
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.

2 participants