[PATCH 04/22] drm/amd: fix the warning unchecking return vaule for sdma_v7

Huang, Tim Tim.Huang at amd.com
Fri May 10 06:27:43 UTC 2024


[AMD Official Use Only - General]

This patch is,

Reviewed-by: Tim Huang <Tim.Huang at amd.com>



> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Jesse
> Zhang
> Sent: Friday, May 10, 2024 10:50 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>; Huang, Tim <Tim.Huang at amd.com>; Zhang,
> Jesse(Jie) <Jesse.Zhang at amd.com>; Zhang, Jesse(Jie)
> <Jesse.Zhang at amd.com>
> Subject: [PATCH 04/22] drm/amd: fix the warning unchecking return vaule for
> sdma_v7
>
> check ring allocate success before emit preempt ib
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
> b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
> index 0b5af1c50461..7db53a96cff0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
> @@ -1347,7 +1347,11 @@ static int sdma_v7_0_ring_preempt_ib(struct
> amdgpu_ring *ring)
>
>       /* emit the trailing fence */
>       ring->trail_seq += 1;
> -     amdgpu_ring_alloc(ring, 10);
> +     r = amdgpu_ring_alloc(ring, 10);
> +     if (r) {
> +             DRM_ERROR("ring %d failed to be allocated \n", ring->idx);
> +             return r;
> +     }
>       sdma_v7_0_ring_emit_fence(ring, ring->trail_fence_gpu_addr,
>                                 ring->trail_seq, 0);
>       amdgpu_ring_commit(ring);
> --
> 2.25.1



More information about the amd-gfx mailing list