]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu/gfx9: fix kiq locking in KCQ reset
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Jul 2025 13:38:27 +0000 (09:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Jul 2025 18:07:17 +0000 (14:07 -0400)
The ring test needs to be inside the lock.

Fixes: fdbd69486b46 ("drm/amdgpu/gfx9: wait for reset done before remap")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Jiadong Zhu <Jiadong.Zhu@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 76ba664efecb3e9f9c72511b1859ca43d9fb64a2..4c61157405b078928e38fef4c2b2f61e5f241263 100644 (file)
@@ -7238,8 +7238,8 @@ static int gfx_v9_0_reset_kcq(struct amdgpu_ring *ring,
        }
        kiq->pmf->kiq_map_queues(kiq_ring, ring);
        amdgpu_ring_commit(kiq_ring);
-       spin_unlock_irqrestore(&kiq->ring_lock, flags);
        r = amdgpu_ring_test_ring(kiq_ring);
+       spin_unlock_irqrestore(&kiq->ring_lock, flags);
        if (r) {
                DRM_ERROR("fail to remap queue\n");
                return r;