Repository navigation
drm/asahi: hold GPU power domain across suspend_noirq for deferred commit stop - #3865
Merged
Merged
Conversation
…mmit stop The g14_v27_2 backend keeps the GPU ASC firmware alive through dpm_suspend_noirq() during firmware-driven deep sleep and defers halting it to its sleep commit callback (g14_v27_2_commit_stop). Previously asahi_sleep_pd_suspend_noirq() returned early whenever pm_suspend_via_firmware() was true, allowing genpd_suspend_noirq() to power off the GPU's attached power domain before commit. When the GPU attaches through pmp_report_gfx to ps_gfx without apple,sleep-retained on ps_gfx, genpd powered down pmp_report_gfx and ps_gfx under the still- running GPU ASC firmware, causing an immediate bus hang before commit. Add asahi_sleep_pd_suspend_noirq_hold(dev, hold_firmware) so backends that defer stopping GPU firmware to the sleep commit hook can retain the GENPD_NOTIFY_PRE_OFF veto across suspend_noirq() in firmware-driven sleep as well as s2idle. Wire SLEEP_OPS.suspend_noirq through sleep_suspend_noirq_driver() and report holds_pd_in_firmware_sleep() from g14_v27_2 when a commit-stop hook is armed. Signed-off-by: Satya Benson <satya@benson.earth>
RyanTheTide
approved these changes
Dec 2, 2026
RyanTheTide
left a comment
Contributor
There was a problem hiding this comment.
The firmware-sleep hold is tied to successful registration of the deferred stop, and resume_noirq still removes the notifier. The J413 row exercises the offending domain topology in both s2idle and committed deep sleep and verifies render readback after wake.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
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.
Summary
Fixes the T8112 committed deep-sleep hang introduced when #3789 attached
gpu@206400000topmp_report_gfx(report@6, parentps_gfx).Root cause
g14_v27_2backend keeps GPU ASC firmware alive acrossdpm_suspend_noirq()during firmware-driven deep sleep and defers halting it to its sleep commit hook (g14_v27_2_commit_stop).asahi_sleep_pd_suspend_noirq()returned early wheneverpm_suspend_via_firmware()was true, sogenpd_suspend_noirq()powered offpmp_report_gfx, droppedps_gfx's active subdomain count to 0, and powered downps_gfxunder the live GPU ASC firmware before commit.t8112-j413-fw27.dts,t8112-j415-fw27.dts,t8112-j493-fw27.dts),ps_gfxdoes not setapple,sleep-retained, causing an immediate hardware hang before commit.Fix
asahi_sleep_pd_suspend_noirq_hold(struct device *dev, bool hold_firmware)indrivers/gpu/drm/asahi/sleep_pd.{c,h}, keepingasahi_sleep_pd_suspend_noirq(dev)as a wrapper passingfalse(matching the hook shape in drm/asahi: m3: support firmware-driven deep sleep on T8122 #3504 so both PRs merge cleanly).holds_pd_in_firmware_sleep()ong14_v27_2::Runtime/Backend, returning true when acommit_stophook is armed underCONFIG_APPLE_SOC_SLEEP.SLEEP_OPS.suspend_noirqindrivers/gpu/drm/asahi/driver.rsthroughsleep_suspend_noirq_driver()sogenpdretains theGENPD_NOTIFY_PRE_OFFveto onpmp_report_gfx(keepingps_gfxpowered) until commit stops the GPU ASC and lowersps_gfxcleanly.Required to restore T8112 committed deep sleep on J413/J415/J493 after #3789 and unblock #3786.
Tested: MacBook Air 13" M2 (J413, T8112, 27.2 stub) at exact PR head
f14fa751845f(overmain65c41b72ae27) with unmodified post-#3789t8112-j413-fw27.dtb(gpu -> pmp_report_gfx, noapple,sleep-retainedonps_gfx,apple_pmpactive):mem_sleep=[s2idle]): boot clean,0failed units,0new kernel errors, 3/3s2idle(rtcwake -d rtc1 -m freeze -s 10,pmp-gfxRejected 0->3,gfxUsage=1unchanged), 25-frame GLES2/EGL render+readback PASS pre- and post-sleep, MTP 3/3 inputs intact.apple_sleep.deep=1 apple_sleep.untested_commit=1,mem_sleep=s2idle [deep]): 3/3 committed deep sleeps (rtcwake -d rtc1 -m mem -s 10),boot object resumes 0 -> 1 -> 2 -> 3,agx=1 gfx_err=0on all 3 cycles,GPU firmware 27.2 back in 4316 / 3765 / 5838 us (commit idle=0 230 / 240 / 240 us),pmp-gfxUsage=0 Rejected 0->1->2->3,gfxUsage=1 Rejected=0,0GPU/PMP warnings or errors,0failed units, 25-frame GLES2/EGL render+readback PASS pre- and post-cycle-3, MTP 3/3 inputs intact. (Pre-existing unrelated BCM4387D3hot to D0/ Bluetooth0x0c01rebind messages observed on deep wake.)tools/asahi/run-host-tests.py --only g14(25/25) and--only pmpPASS;scripts/checkpatch.pl0 errors / 0 warnings.g14_v27_2GPU backends (g16,g17,SLEEP_REFUSE_OPSkeephold_firmware = false).Risk: Two-way door affecting T8112
g14_v27_2Macs during firmware-driven deep sleep. Only activates theGENPD_NOTIFY_PRE_OFFveto during firmware sleep wheng14_v27_2has a deferredcommit_stophook armed;s2idleand all other GPU backends (g16,g17,SLEEP_REFUSE_OPS) are unchanged.