Repository navigation
drm/asahi: g17: stop cancelling behind a failed command once it has retired - #556
Merged
RyanTheTide merged 1 commit intoOct 31, 2026
Conversation
…etired A queue remembered the earliest failed ordinal of each engine for good, and every later command whose prefix covered it was cancelled. GL orders each submission after every earlier one, so once one command of a queue failed, every later command of that queue was cancelled too. With cancellation no longer reported as a lost device, the client never noticed: after a CS2 GPU hang, one Hyprland render that sampled the game's failed buffer was cancelled, then every later Hyprland render (about 47 a second, all fences ECANCELED), and the screen kept the game's last frame until Hyprland or the machine restarted. New buffers did not help; the queue itself was poisoned. The record exists so that nothing runs before a failed producer the firmware may still own or replay. That holds only while the command keeps its VM pin: complete() and fail_unpublished() release it, fail_while_owned() keeps it until release_after_retirement(). Track the failed commands that still hold their pin and stop counting each one once it has released it. A failure that cannot be tracked for lack of memory keeps cancelling for good, as before. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com> Assisted-by: LLM
Contributor
|
Merged into integration/aurora. Hardware: on the J616s a second client submitted a hanging dispatch while glmark2 looped (4 runs around 7000, 6928 after): the other client kept completing, no stray cancels, no GPU faults, journalctl -k -p 3 empty, no WARN or DART faults. The M2, M1 Pro and Neo passed with it in the integration candidate, including 3 concurrent glmark2 clients for 60 s with 0 GPU errors. Thanks! |
This was referenced Oct 31, 2026
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.
Problem
Each g17 queue recorded the earliest failed ordinal per engine (
failures[engine]) and kept it for the queue's lifetime. Any later command whose prefix covered that ordinal was cancelled. GL submits with a full prefix (every command orders after every earlier one), so after one failed command, every later command of that queue was cancelled too, forever.Since cancellation is no longer reported as a device loss, the client never notices. Seen on a J616s (M4 Pro):
ECANCELED.Fix
The record exists so that nothing runs before a failed producer that the firmware may still own or replay. That only holds while the command keeps its VM pin:
complete()andfail_unpublished()release the pin.fail_while_owned()keeps it untilrelease_after_retirement().FailureRecordnow tracks the failed commands that still hold their pin, and drops each one once it has released the pin. A failure that cannot be tracked because memory runs out still cancels for good, as before.Testing
asahi_g17_dependency, new): 4 tests. Three of them fail on the old keep-forever behaviour. 188/188 pass onintegration/aurorawith the change.Relation to #433
This is independent of #433 and applies cleanly to
integration/aurorawithout it. #433 keeps innocent clients alive across another client's recovery. This change stops a client's own queue from staying poisoned after one cancelled command. The two are complementary: with #433 alone, the desktop still froze after a CS2 hang.Assisted-by: LLM