Skip to content

Commit 2d10c3d

Browse files
Jie1zhangalexdeucher
authored andcommitted
drm/amdgpu: add check before free wb entry
Check if ring is not a mes queue before freeing the wb entry, because we only allocate a wb entry when it's not a mes queue. Signed-off-by: Jesse Zhang <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent cd48b97 commit 2d10c3d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,8 @@ static int sdma_v5_0_ring_test_ring(struct amdgpu_ring *ring)
999999
r = amdgpu_ring_alloc(ring, 20);
10001000
if (r) {
10011001
DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
1002-
amdgpu_device_wb_free(adev, index);
1002+
if (!ring->is_mes_queue)
1003+
amdgpu_device_wb_free(adev, index);
10031004
return r;
10041005
}
10051006

drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,8 @@ static int sdma_v5_2_ring_test_ring(struct amdgpu_ring *ring)
839839
r = amdgpu_ring_alloc(ring, 20);
840840
if (r) {
841841
DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
842-
amdgpu_device_wb_free(adev, index);
842+
if (!ring->is_mes_queue)
843+
amdgpu_device_wb_free(adev, index);
843844
return r;
844845
}
845846

drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,8 @@ static int sdma_v6_0_ring_test_ring(struct amdgpu_ring *ring)
861861
r = amdgpu_ring_alloc(ring, 5);
862862
if (r) {
863863
DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
864-
amdgpu_device_wb_free(adev, index);
864+
if (!ring->is_mes_queue)
865+
amdgpu_device_wb_free(adev, index);
865866
return r;
866867
}
867868

0 commit comments

Comments
 (0)