drm/amdgpu/gfx9: make KFD usable again after MODE2 on Renoir
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | drm/amdgpu/gfx9: factor out HQD deactivation and fix its timeout checkdrivers/ | +29 | 0 replies | |
| 2/2 | drm/amdgpu/gfx9: deactivate all compute HQDs before MODE2 on Renoirdrivers/ | +53 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] drm/amdgpu/gfx9: make KFD usable again after MODE2 on Renoir
On Renoir/Cezanne (GC 9.3.0) a MODE2 reset reports success, graphics and the kernel compute queues come back, but KFD stays dead until reboot:
every new KFD queue runs into "qcm fence wait loop timeout expired" and triggers the next reset. Reported in
https://gitlab.freedesktop.org/drm/amd/-/issues/6177, sent here as asked there.
Commit c3988a7ad479 ("drm/amdgpu/gfx9: Fix Ring and IB test fail after mode2") already found that MODE2 does not reset the HQD registers on gfx9 APUs and deactivates the KCQ HQDs before the reset. The HIQ used by KFD survives as well, though: kq_uninitialize() skips destroy_mqd() during a reset because it cannot take the reset domain semaphore. After MODE2 the MEC restarts with the stale HIQ and the HWS no longer answers. The same trylock pattern on the MES side is discussed in
https://gitlab.freedesktop.org/drm/amd/-/issues/6053.
Patch 1 is a small cleanup plus a fix for the timeout check of the existing dequeue loop. Patch 2 deactivates all active compute HQDs (except the KIQ) before MODE2, restricted to GC 9.3.0 because that is the only gfx9 APU I could test. Raven/Picasso likely need the same, but I don't know this code well enough to widen the condition without hardware to test on.
Tested on a Ryzen 5 5600G (gfx90c), MEC firmware 0x1e3, HWS, amdgpu.noretry=1. An instrumented build used the old path for the first MODE2 and the new path for later ones, so both were compared in the same boot:
old path: HIQ still ACTIVE with the old MQD/PQ after MODE2; next HIP
program -> "qcm fence wait loop timeout", GPU hang, reset
new path: only the KIQ active at resume, HIP/rocBLAS tests pass
Since then the patches run as the boot-time amdgpu module on the Proxmox 7.0.14 kernels (-29 and now -30): requested reset with 9 HQDs deactivated and the KIQ skipped, HIP/rocBLAS work before and after. On amd-staging-drm-next (8dd68a795) the series applies with offsets and builds without warnings (W=1).
The analysis and the patches were prepared with an AI coding assistant (see the Assisted-by tags); I tested them on the hardware described above.
Christoph Berliner (2):
drm/amdgpu/gfx9: factor out HQD deactivation and fix its timeout check drm/amdgpu/gfx9: deactivate all compute HQDs before MODE2 on Renoir
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 105 ++++++++++++++++++++------ 1 file changed, 82 insertions(+), 23 deletions(-)
Signature · 1 line
2.56.1