Skip to content

drm/asahi: g17: refuse a sleep the commit can't stop - #1839

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
neo-ds/g17-sleep-refuse
Nov 13, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
neo-ds/g17-sleep-refuse

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

The G16 counterpart is in #1314: when the sleep's commit can't take the GPU's stop, G16 now refuses the sleep in .prepare. G17 still had a fallback there, which this removes.

Before. If asahi_g17_commit_prepare() failed and asahi_g17_commit_required() was false, G17's .prepare stopped the firmware itself ("no GPU stop at the commit: stopping it now"). Any later refusal of that sleep then took .complete into sleep_hold(): the firmware stayed stopped and publication stayed closed until the next real sleep. Every GPU job hung meanwhile.

After. .prepare only drains, checks for quiet and leaves the stop to the commit, or refuses the sleep with EBUSY if the commit can't take it. A sleep refused before the commit then always finds the firmware never stopped, and .complete just reopens publication.

Reach. The A18 Pro (T8140) is the only G17 chip with sleep_restart; the others refuse sleep outright. On it, the GPU's .prepare only runs for a firmware sleep (driver.rs). The only source of those is the sleep driver, which leaves the stop to its commit, so asahi_g17_commit_required() is true and the fallback was not reached. The change takes out a stop path that a future sleep path could reach, and with it the Rust stop sequence (down(), and the idle/wake/stop hardware steps it alone used) and their kunit tests. up(), hold() and lower_domain() keep theirs. asahi_g17_commit_required() stays in sleep.c/sleep.h for now, to stay clear of #1314's lines there.

Testing

  • CI on this head.
  • MacBook Neo (J700), on a one-shot test boot of this aurora.ko:
    • two late refusals forced through the PM core's pm_test (devices, then platform: every device suspended, then the sleep refused before the platform's enter, where the commit runs);
    • one normal DRAM-kept sleep;
    • a GPU smoke (dEQP triangle, gpubench, vkcube) and the kernel log checked for GPU faults after each.
    • Results to follow.

🤖 Generated with Claude Code

Where the sleep's commit couldn't take the GPU's stop and the sleep
driver didn't require it, .prepare stopped the firmware itself. A later
refusal of that sleep then left the GPU stopped, with publication
closed, until the next real sleep: the hole #1314 closes for G16.

Refuse the sleep instead, as G16 does. On the A18 Pro, the only G17
chip that sleeps, the GPU's .prepare only runs for a sleep the sleep
driver takes, and that leaves the stop to its commit, so the fallback
wasn't reached. With it go the Rust stop and its tests.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Tested on the MacBook Neo (J700), 2026-11-13. A one-shot test boot ran this change as aurora.ko, built from the same g17/sleep.rs on a slightly older integration base (the file is identical there), against the Neo's default kernel. Then back to the default boot. PASS.

  • Two late refusals, forced through the PM core's pm_test (devices, then platform): every device suspended, then the sleep was refused before the platform's enter, where the commit runs.
    • Each logged sleep refused before the commit: GPU firmware never stopped, and neither logged stays stopped until a real sleep.
    • After each, the GPU passed a fresh-process Vulkan triangle (dEQP) and a gpubench render.light row (status: ok).
  • One normal DRAM-kept sleep, woken by the PMU RTC: the GPU firmware restarted, and nothing was refused or lost. The same smoke passed afterwards.
  • Kernel log: no GPU fault or GPU driver warning over the whole run.
  • vkcube: it couldn't reach the session's Wayland socket from the test harness, at the start too, so it didn't count either way.
  • Before merge: CI (host-tests) green on this head. No new compiler warnings: the dead-code warning set equals that of a build of the same base without this change.

@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 13, 2026 19:04
@DjDeveloperr
DjDeveloperr merged commit 6be25d6 into integration/aurora Nov 13, 2026
1 check passed
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.

1 participant