Skip to content

drm/asahi: workqueue: Defer freeing the last completed work item - #493

Closed
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
fix/t3171-g13x-firmware-object-lifetime
Closed

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
fix/t3171-g13x-firmware-object-lifetime

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Carries Asahi Lina's upstream fix 855c62f853cb on integration/aurora at 9cbdd0734d9e.

WorkQueue::signal() can enqueue the final completed firmware command for destruction before publishing its ring free pointer. Retain that command until a later completion or queue teardown, as in Asahi's implementation. This replaces the earlier implementation in this PR with the upstream cherry-pick, preserving Asahi Lina's authorship, author date and original message.

The only adaptation is using this tree's workqueue::system_dfl() API at both cleanup enqueue sites. No kernel parameters or module flags are added.

Validation: git diff --check passes; strict checkpatch reports 0 errors, 0 warnings and 0 checks. The universal 7.3.0-aurora-g13w build passes with the same generated config as the q423 reference.

Runtime acceptance failed. The frozen 41-case reproducer, requested for 50 repetitions at eight jobs with stock Mesa 26.1.3, hit another GPU firmware stop during repetition 4. The first three repetitions completed; the failing chunk returned 137 with zero OOM kills, and the watchdog stopped the campaign. This upstream carry is insufficient to resolve the observed G13 stop. Full73 was canceled after this failure. Keep this PR draft pending further investigation.

Assisted-by: LLM

Maybe helps with firmware crashes?

Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 855c62f853cb3a3b50dd4e48d46e2c8663afe7d5)

Adaptation: use this tree's workqueue::system_dfl() API in both
cleanup enqueue sites, matching the existing workqueue call.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide force-pushed the fix/t3171-g13x-firmware-object-lifetime branch from 6df6095 to 2b14d6d Compare October 26, 2026 07:48
@RyanTheTide RyanTheTide changed the title drm/asahi: defer freeing the last completed work item drm/asahi: workqueue: Defer freeing the last completed work item Oct 26, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Closing this draft: the carried last-completed-work-item retention did not eliminate the G13 firmware stop in verification.

Upstream Asahi has also reverted the equivalent change in 83526ea43d4f, “drm/asahi: workqueue: Drop completed work items”. Retaining the last item pins a BufferManager slot and limits userspace to at most 127 queues. This carry should not merge; any subsequent lifetime fix needs a bounded retention mechanism that avoids pinning those slots.

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