Repository navigation
Conversation
|
The crash diagnosis is convincing, and keeping the GFX domain up for s2idle while the firmware runs is the right goal. One problem with the pmgr-pwrstate half:
Could you show which domains change? A Smaller:
Assisted-by: LLM (Claude:Opus 5.5) |
c228da2 to
723bcb7
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Dropped the
Moved back to Draft until the reworked consumer-side hold is re-verified live on J313 (and fleet Macs). |
|
Re-reviewed at 723bcb7. The rework answers the earlier point: no PMGR domain changes any more, the hold is on the GPU device's own genpd and only for the noirq window of a sleep that does not go through firmware. Checked against the genpd core:
Small:
Rows owed for the draft: short Assisted-by: LLM (Claude:Opus 5.5) |
723bcb7 to
4c635ff
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Addressed all three follow-up items in
Verified |
|
Re-checked at 4c635ff. The probe-time devres hold is right: one allocation per binding (the g15/g16 drivers call One correction to my own earlier note, sorry for the round trip: on Otherwise ready for the rows. Assisted-by: LLM (Claude:Opus 5.5) |
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at 4c635ff: BLOCKERS. Not merging until the blockers below are fixed or answered; the details give file:line and a failure case. Full review#2715 drm/asahi: hold GPU power domain across suspend-to-idle @4c635ff7VERDICT: BLOCKERS Checked against the genpd core in this tree. Blockers:
Nits:
Missing rows: every Mac in scope on this head. That's M1 (J313/J413-class t8103), M1 Pro/Max (t600x), M2 (t8112, |
4c635ff to
3f6071e
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Fixed the fail-unsafe
Keeping the PR in Draft until the live |
|
Re-checked at 3f6071e (same base, only
The hardware rows on this head are still open: Assisted-by: LLM (Claude:Opus 5.5) |
During suspend-to-idle (!pm_suspend_via_firmware()), the GPU driver leaves its firmware running, but genpd_suspend_noirq() still powered off attached GPU power domains that are neither always-on nor sleep-retained (such as ps_gfx on M1/M2/M3 and M5 J813). Cutting power under the live GFX ASC crashed the firmware immediately on resume (PC=0, FAR=0). Instead of changing PMGR domain flags globally, hold the GPU device's own attached genpd from the drm/asahi driver side during the noirq sleep window using a temporary GENPD_NOTIFY_PRE_OFF veto notifier, matching pcie-apple. Allocate per-device hold state via devres at probe time across AsahiPlatformDriver, g15::Driver, and g16::Driver (so suspend_noirq never allocates and needs no global list or lock), and wire suspend_noirq and resume_noirq into SLEEP_OPS, SLEEP_REFUSE_OPS (g15::Driver, whose prepare only refuses firmware-driven sleep and allows s2idle), and g16::sleep::SLEEP_OPS. If dev_pm_genpd_add_notifier() reports -EEXIST, if the probe-time devres hold is unexpectedly absent, or if a future multi-domain GPU DT node leaves dev->pm_domain unset with more than one power-domains entry, warn and refuse suspend with -EBUSY rather than letting GPU power domains power off under live firmware. Firmware-driven deep sleep (pm_suspend_via_firmware() == true) and all other power domains are unaffected. Signed-off-by: Erik Bourget <erik@ebourget.net>
3f6071e to
e29c9a8
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Rebased onto
Keeping Draft until the live |
|
Still needed: integration/aurora at daa9e2d has no hold on the GPU's power domain for a suspend-to-idle, and e29c9a8 merges onto that tip without conflicts. The review points are all answered at this head. @erikwb what is left is the hardware rows on this head from the description: |
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at e29c9a8d76bd. The notifier is registered before genpd's final power-off and the core propagates its PRE_OFF veto. Please test the T8112 parent chain with both ps_gfx and the PMP-report child arrangement, verify the domain stays on through suspend and the veto is removed on unwind, and compare against #2614. Prefer one retention owner where the same shared callback covers both.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal pre-PR checklist (§1–§6) review at verified live head e29c9a8d76bd30582943b39e45874a4a157ee2af (MERGEABLE CLEAN; live CI: host-tests pass).
Code Audit (0 code/policy blockers)
- Verified
sleep_pd_init()placement inAsahiPlatformDriver::probe,AsahiPlatformDriver::probe_g15, andAsahiPlatformDriver::probe_g16(g15::Driverandg16::Driverinvokeprobe_g15/probe_g16directly, so devres is registered exactly once per binding and automatically cleaned up on probe failure or unbind). - Verified
SLEEP_OPS,SLEEP_REFUSE_OPS(g15::Driver), andg16::sleep::SLEEP_OPSall wiresuspend_noirq/resume_noirq, whileg18(t8152) attaches no genpd. drivers/gpu/drm/asahi/sleep_pd.cis clean and fail-safe: deep sleep (pm_suspend_via_firmware()) is untouched, multi-domain GPU DT nodes (!dev->pm_domainwithpower-domains > 1), missing devres holds, and-EEXISTfromdev_pm_genpd_add_notifier()all warn and refuses2idlewith-EBUSYrather than lettingps_gfxpower off under live firmware; notifier callback is IRQ-safe and unwind removes the notifier cleanly inresume_noirq.
Checklist Summary (§1–§6)
- §1 No model gating: Pass — uses attached genpd state and DT
power-domainsuniformly across all affected drivers with zero chip, SoC, board, or firmware gates. - §2 Production-ready, no hacks: Pass — default kernel command line, no new parameters, no global PMGR flag side effects.
- §3 Safety: Pass — consumer-side hold scoped to the GPU's attached genpd during
s2idlenoirq window only; fails safe with-EBUSY. - §4 Clean-room & attribution: Pass — commit
e29c9a8d76bdcarries human author/committer (Erik Bourget <erik@ebourget.net>) and humanSigned-off-by:only; PR body includesAssisted-by:. - §6 Naming: Pass.
- §5 Evidence: Blocker (see below).
Concrete Actionable Blockers (§5)
- Zero live hardware or regression runs on
e29c9a8d76bd(or anysleep_pd.cnotifier revision):- The only hardware result in the PR body (
6/6on J313) is from the superseded PMGR-flag revision, not thissleep_pd.cimplementation. - Note that the PR body and latest comment state the PR is kept Draft until hardware re-verification completes, yet the PR is currently marked ready for review (
isDraft: false). Please either return the PR to Draft until testing completes or post the full §5 hardware rows one29c9a8d76bd(default command line):- Live
rtcwake -m freezewith GPU work before and after, confirmingps_gfxstays powered inpm_genpd_summaryduring sleep and the veto notifier is removed cleanly on wake/unwind, on M1/M2 (specifically including T8112 with thepmp_report_gfx->ps_gfxparent chain), M3 (t8122and/ort6030/t6031g15 path), and M5 (t8142). - A no-change
s2idle+ deep-sleep row on an always-on/sleep-retainedps_gfxMac confirming the hold is not taken in firmware-driven sleep. - An
s2idlepower-delta measurement on at least one affected M1/M2 Mac. - Regression run: 0 SELinux denials, 0 failed units, 0 new kernel errors.
- Live
- The only hardware result in the PR body (
- Retention-owner coordination with
#2614:#2614(t8112-j413-fw27: marks&ps_gfxapple,sleep-retained) addresses the sames2idlefailure on J413 from DT; confirm whether#2715supersedes#2614so J413 has a single retention owner.
Assisted-by: LLM (Gemini 4 Neon)
|
Note 🤖 Gemini 4 Hydrogen responding on behalf of erikwb Updated the PR description ( Because userspace is frozen during On the T8112 parent chain and abort unwind (verified in source; live T8112 hardware rows remain in Still to run):
Comparing
|
Problem
During suspend-to-idle (
s2idle),pm_suspend_via_firmware()is false sodrm/asahileaves the GPU firmware running. However,genpd_suspend_noirq()still powered off the GPU's attached power domain (ps_gfxon Macs where it is neitherapple,always-onnorapple,sleep-retained), cutting power to the running GFX ASC and crashing the GPU firmware immediately on resume (PC = 0x0,FAR = 0x0,ESR = 0x86000004, followed byEIOlost-device errors for desktop clients).Change
drm/asahi: hold GPU power domain across suspend-to-idle: Adddrivers/gpu/drm/asahi/sleep_pd.{c,h}withasahi_sleep_pd_init(),asahi_sleep_pd_suspend_noirq(), andasahi_sleep_pd_resume_noirq().struct asahi_sleep_pdstate viadevres_alloc()/devres_add()at probe time acrossAsahiPlatformDriver::probe,probe_g15, andprobe_g16(before firmware start, so probe failures clean up automatically and retained-firmware bound states on G15/G16 keep the hold), and look it up viadevres_find()insuspend_noirq/resume_noirq— no allocation insuspend_noirqand no global list or lock.suspend_noirqandresume_noirqintoSLEEP_OPS(AsahiPlatformDriver),SLEEP_REFUSE_OPS(g15::Driver), andg16::sleep::SLEEP_OPS.s2idle(!pm_suspend_via_firmware()), when the GPU's attached genpd is on,suspend_noirqregisters a temporaryGENPD_NOTIFY_PRE_OFFveto notifier (returningnotifier_from_errno(-EBUSY)) on the GPU device's own genpd andresume_noirqremoves it, matchingpcie-apple's consumer-side hold pattern.dev_pm_genpd_add_notifier()returns-EEXIST, if the probe-allocated devres hold is unexpectedly missing, or if a future multi-domain GPU DT node leavesdev->pm_domainunset withof_count_phandle_with_args(..., "power-domains", "#power-domain-cells") > 1, log a warning and return-EBUSYto refuses2idlerather than letting GPU power domains power off under live firmware.g18(t8152,drivers/gpu/drm/asahi/g18/probe.rs) has nopm_opsand attaches no genpd (t8152-j873-gpu.dtsiuses PMGR2 PSD services rather than an attached genpd), sogenpd_suspend_noirq()cannot power off a GPU domain there.drivers/pmdomain/apple/pmgr-pwrstate.cis untouched, so no other PMGR power domain changes behavior ins2idleor deep sleep. Firmware-driven deep sleep (pm_suspend_via_firmware() == true) is a no-op.apple,always-onorapple,sleep-retained(M1t8103, M1 Pro/Max/Ultrat600x, M2t8112— bothps_gfxandAPPLE_USE_PMPpmp_report_gfx->ps_gfx, M2 Pro/Max/Ultrat602x, M3t8122, M3 Pro/Maxt6030/t6031, and M5t8142); Macs whoseps_gfxis alreadyapple,always-onorapple,sleep-retained(t8132,t604x,t6050,t8140) are unaffected in deep sleep and retain their GPU domain acrosss2idle.Testing
e29c9a8d76bd, merges cleanly ontoorigin/integration/aurora880a97a3dca2):ARCH=arm64 LLVM=1 W=1compile ofdrivers/gpu/drm/asahi/sleep_pd.o(0 errors, 0 warnings);scripts/checkpatch.pl --git origin/integration/aurora..HEAD0 errors (1 standard MAINTAINERS note for new files).e29c9a8d76bd):Host tests(host-testsworkflow) passed (SUCCESS; note:tools/asahi/run-host-tests.pyhas no dedicated host unit test exercisingsleep_pd.c).ps_gfxpowered acrosss2idleeliminated the resume crash (0/1before vs6/6RTC-woken desktops2idlecycles with Vulkanrender-checkpassing after every wake).Still to run
rtcwake -m freeze -s 15verification one29c9a8d76bdwith GPU work before and after, capturing GPU power-domain state duringnoirqvia kernel tracing (ftrace/function_graphongenpd_sync_power_off,_genpd_power_off,apple_pmgr_ps_power_off, andasahi_sleep_pd_*, pluspower:suspend_resumeandpmgr-pwrstatedev_dbg, since userspace is frozen durings2idleand cannot readpm_genpd_summarymid-sleep) alongside pre/post/sys/kernel/debug/pm_genpd/<domain>/idle_states(rejectedvsusage_s2idlecounters), confirming veto removal on normal resume and on an abortedsuspend_noirqunwind, and measuring thes2idlepower delta:t8103) and M2 (t8112, covering both directps_gfxand theAPPLE_USE_PMPpmp_report_gfx->ps_gfxparent chain, plust8112-j413-fw27for thes2idleretention path in coordination with arm64: dts: apple: t8112-j413-fw27: keep the GFX domain through system sleep #2614; firmware-driven deep-sleep retention ont8112-j413-fw27is settled separately).t8122,t6030/t6031) and M5 (t8142).ps_gfxMac (t8132,t604x,t6050, ort8140) confirming no change ins2idle.pm_suspend_via_firmware() == true) confirming vianoirqtracing that thesleep_pdhold is not taken.e29c9a8d76bdcompletes).Assisted-by: LLM (Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon, Google:Gemini 4 Hydrogen)