Repository navigation
drm/imagination: apple: A7 compute hangs: two compute records, rewritten after retirement - #30
Conversation
The firmware takes a work-ring entry at once. For an entry still untaken 50 ms after its doorbell (and after the last such ring), ring the doorbell again from the completion check, log it (rate-limited) and count it in the debugfs doorbell line as rekicks. This is a diagnostic: in the A7 compute hangs (job never taken, work ring N-1/N) it rang for 5 s without the firmware taking the entry, so those were not lost doorbells (see the next patch). Ringing for an entry the firmware took already adds no work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFMaVcR5gEPcdDR8wQfiDP Assisted-by: LLM
…tirement
The firmware keeps using a record after its finish stamp: it reads the
mirror stamp's address and value from it and runs the microsequence to
its end op, as it does for 3D records (two alternating 3D records fixed
a SoC freeze there). The compute path waited only for the finish stamp
and then rewrote its one record and microsequence in place.
On the A7 a compute job every few thousand was then never taken: the
job before it showed its finish stamp but never its mirror stamp
("stamps N-2 N-1", work ring N-1/N), the other engines idle, no fault,
until the 5 s timeout reset the GPU. Nine such hangs over six boots
were identical; ringing the doorbell again every 50 ms for 5 s did not
move the work ring, so the doorbell was not lost.
Alternate two compute records (the second in the unused root page
behind the compute channel), and rewrite a record only once the job
that last used it shows its mirror stamp too, as the A9 path waits for
both stamps and Apple's kext reuses a record only after its stamps
retire. Fences still signal on the finish stamp.
a7_cu_records (1|2) and a7_cu_mirror_wait (0|1) switch it at runtime;
debugfs apple_jobs and the hang report count how often the previous job
was still retiring at a submit, and the longest mirror wait.
On the J71: 6 browser starts on the GPU under swap plus 161 large-copy
runs in parallel, no hang (before: one every few thousand compute jobs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFMaVcR5gEPcdDR8wQfiDP
Assisted-by: LLM
Drop the re-ring of a work-ring entry left untaken 50 ms after its
doorbell. It was a diagnostic for the A7 compute hang, which the two
alternating compute records fix: the entry was not lost, the job before
it had not finished retiring. On the J71 it went on firing with an
elapsed time that cannot be right ("untaken 768614336404 ms"), so it
added noise and no fix.
Assisted-by: LLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFMaVcR5gEPcdDR8wQfiDP
Two compute records, each rewritten only once its last job shows its mirror stamp, are the behaviour the A7 needs, not a choice: with one record, or without the wait, a compute job every few thousand is never taken. Drop the a7_cu_records and a7_cu_mirror_wait module parameters that switched between them during bring-up; the debugfs counters stay. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFMaVcR5gEPcdDR8wQfiDP
|
Ready for review. Two follow-up commits clean up the bring-up leftovers:
Built with The silent J71 freezes seen during browser soaks are not caused by this driver: they reproduce with headless Firefox and the 🤖 Generated with Claude Code |
Bring the A7 GPU bring-up page up to date: the GPU desktop of OrchardLinux/mesa#25 (Omarchy, Web and Firefox on the GPU, and the driver fixes found on the way), the compute-record fix of OrchardLinux/linux#30, what a J71 did under browser load (silent freezes confounded by a near-empty battery on a 500 mA host port, recoverable 3D lockups, about 220 MB of GPU memory that no eviction can free on the A7), what exists outside Orchard, and the open work. Assisted-by: LLM
|
Merged, thank you! Two alternating compute records, each reused only after its mirror stamp, is a solid root-cause fix for the A7 compute hangs. It ships with the next orchard release. @brkosebay, the A8 runs the same t7000 compute path, so you'll see this on the A8 too. |
drm/imagination: apple: A7 compute hangs: two compute records, rewritten after retirement
Draft, to let others know: the A7 desktop's GPU hangs are understood and fixed in testing. Not ready to merge.
The hang
About every 10-60 minutes of desktop use on the iPad Air (J71), more often under memory pressure (a browser starting), one compute job was never taken by the firmware. It always looked the same:
The 5 s timeout then reset the GPU; Quickshell lost its device and the screen went black.
Cause
The two stamp words are the mirror stamp and the finish stamp. In all 9 hangs over 6 boots, job N-1 had written its finish stamp but never its mirror stamp: the firmware never finished retiring it. It keeps using a record after the finish stamp (it reads the mirror's address and value and runs the microsequence to its end op), as with 3D records, where two alternating records already fixed a SoC freeze. The t7000 compute path waited only for the finish stamp and then rewrote its single record and microsequence in place, so a back-to-back compute job could land in that window.
The first patch (re-kick) tested the "lost doorbell" theory: on the device it rang every 50 ms for 5 s and the firmware still never took the entry. It stays as a diagnostic.
Fix (second patch)
a7_cu_records(1|2) anda7_cu_mirror_wait(0|1) switch it at runtime (1/0 = the old behaviour); debugfsapple_jobsand the hang report count how often the previous job was still retiring at a submit.Testing (J71, installed Omarchy)
orchard buildyet), installed, rebooted.Also found:
rmmod powervroopses inremove_nodes(devres) on the A7; not addressed here.🤖 Generated with Claude Code
https://claude.ai/code/session_01SFMaVcR5gEPcdDR8wQfiDP