drm/amdgpu: add check before free wb entry
Subsystems (2)
PATCH 1/4 drm/amdgpu: add check before free wb entry
From: Jesse Zhang <[email protected]>
check if ring is not mes queue before free wb entry.
Signed-off-by Jesse Zhang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 3 ++- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +2 -1
@@ -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; }
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +2 -1
@@ -839,7 +839,8 @@ static int sdma_v5_2_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; }
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +2 -1
@@ -861,7 +861,8 @@ static int sdma_v6_0_ring_test_ring(struct amdgpu_ring *ring) r =amdgpu_ring_alloc (ring,5 );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; }
Signature · 1 line
2.25.1
Quoted 4 lines · On Tue, Apr 23, 2024 at 11:27 PM <[email protected]> wrote:
From: Jesse Zhang <[email protected]>
check if ring is not mes queue before free wb entry.
Minor clarification to the commit text:
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.
With that fixed, the patch is:
Reviewed-by Alex Deucher <[email protected]>
Quoted 53 lines
Signed-off-by Jesse Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 3 ++- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +2
-1@@ -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; }drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +2
-1@@ -839,7 +839,8 @@ static int sdma_v5_2_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; }drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +2
-2@@ -861,7 +861,8 @@ static int sdma_v6_0_ring_test_ring(struct amdgpu_ring *ring) r =amdgpu_ring_alloc (ring,5 );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; } --2.25.1