If gfx is hung, we shouldn't need this since gfx won't be powered down, but we could potentially have a case where a queue can be preempted, but due logic errors in the commands, the fence never signals. GFX could potentially go into the off state. Protect against that.
Assisted-by: Claude:claude-opus-4.6 Signed-off-by: Alex Deucher <[email protected]> --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index a35cac55c859d..9055b56e78f4c 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c @@ -5292,8 +5292,14 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring, { struct amdgpu_device *adev = ring->adev; bool use_mmio = adev->gfx.me.use_mmio_for_reset; + int r; - return amdgpu_gfx_mes_reset_queue(ring, vmid, timedout_fence, use_mmio); + if (use_mmio) + amdgpu_gfx_off_ctrl(adev, false); + r = amdgpu_gfx_mes_reset_queue(ring, vmid, timedout_fence, use_mmio); + if (use_mmio) + amdgpu_gfx_off_ctrl(adev, true); + return r; } static int gfx_v12_0_reset_kcq(struct amdgpu_ring *ring, -- 2.54.0
