On 010/01, Alex Deucher wrote:
> Re-emit the unprocessed state after resetting the queue.
> 
> Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 17 ++++++++++++++---
>  1 file changed, 14 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 5a1098bdd8256..577b002fe566c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -1544,14 +1544,25 @@ static int sdma_v5_0_reset_queue(struct amdgpu_ring 
> *ring,
>                                struct amdgpu_fence *timedout_fence)
>  {
>       struct amdgpu_device *adev = ring->adev;
> -     u32 inst_id = ring->me;
>       int r;
>  
> +     if (amdgpu_sriov_vf(adev))
> +             return -EINVAL;
> +
> +     if (ring->me >= adev->sdma.num_instances) {
> +             DRM_ERROR("sdma instance not found\n");
> +             return -EINVAL;
> +     }

Nitpick:
Are these checks part of this commit? I noticed you made a similar
modification in the next commit. Maybe you can put these checks in a
single commit before this one?

Thanks

> +
> +     amdgpu_ring_reset_helper_begin(ring, timedout_fence);
> +
>       amdgpu_amdkfd_suspend(adev, true);
> -     r = amdgpu_sdma_reset_engine(adev, inst_id, false);
> +     r = amdgpu_sdma_reset_engine(adev, ring->me, true);
>       amdgpu_amdkfd_resume(adev, true);
> +     if (r)
> +             return r;
>  
> -     return r;
> +     return amdgpu_ring_reset_helper_end(ring, timedout_fence);
>  }
>  
>  static int sdma_v5_0_stop_queue(struct amdgpu_ring *ring)
> -- 
> 2.50.0
> 

-- 
Rodrigo Siqueira

Reply via email to