[PATCH 1/4] drm/amdgpu: add check before free wb entry

Alex Deucher alexdeucher at gmail.com
Wed Apr 24 03:33:54 UTC 2024


On Tue, Apr 23, 2024 at 11:27 PM <jesse.zhang at amd.com> wrote:
>
> From: Jesse Zhang <jesse.zhang at amd.com>
>
> 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 <alexander.deucher at amd.com>


>
> Signed-off-by: Jesse Zhang <Jesse.Zhang at amd.com>
> ---
>  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(-)
>
> 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;
>         }
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index 43e64b2da575..cc9e961f0078 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -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;
>         }
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> index 1f4877195213..c833b6b8373b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> @@ -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
>


More information about the amd-gfx mailing list