]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu/gfx9.4.3: fix kiq locking in KCQ reset
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Jul 2025 13:42:23 +0000 (09:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:38:48 +0000 (16:38 +0200)
[ Upstream commit 08f116c59310728ea8b7e9dc3086569006c861cf ]

The ring test needs to be inside the lock.

Fixes: 4c953e53cc34 ("drm/amdgpu/gfx_9.4.3: 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_4_3.c

index 264b37e856965537802f051c880e8158b7195542..b3c842ec17ee2a438dfac808986766445252e2c6 100644 (file)
@@ -3612,9 +3612,8 @@ pipe_reset:
        }
        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) {
                dev_err(adev->dev, "fail to remap queue\n");
                return r;