aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
diff options
context:
space:
mode:
authorJesse Zhang <[email protected]>2024-04-24 04:59:22 +0000
committerAlex Deucher <[email protected]>2024-04-26 21:22:43 +0000
commit2d10c3dbde073ac005303b313d3e2cb99381eb6f (patch)
tree4ef7c4de318302cd8058c543f51d6a96ca7d15ef /drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
parentdrm/amdgpu: add return result for amdgpu_i2c_{get/put}_byte (diff)
downloadkernel-2d10c3dbde073ac005303b313d3e2cb99381eb6f.tar.gz
kernel-2d10c3dbde073ac005303b313d3e2cb99381eb6f.zip
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]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index 45a2d0a5a2d7..b7d33d78bce0 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -999,7 +999,8 @@ static int sdma_v5_0_ring_test_ring(struct amdgpu_ring *ring)
r = amdgpu_ring_alloc(ring, 20);
if (r) {
DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
- amdgpu_device_wb_free(adev, index);
+ if (!ring->is_mes_queue)
+ amdgpu_device_wb_free(adev, index);
return r;
}