]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:38:48 +0000 (16:38 +0200)
[ Upstream commit 730ea5074dac1b105717316be5d9c18b09829385 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 23f9981815612486e5b2daf059887959e040939f..f768c407771ac66401631f15463f34a24a769c4f 100644 (file)
@@ -7280,8 +7280,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;