On Wed, Sep 2, 2026 at 8:50 AM Prike Liang <[email protected]> wrote:
>
> amdgpu_mes_detect_and_reset_hung_queues() already detects
> the guilty compute user queue and resets it through
> mes_userq_reset_queue(). The additional reset via
> mes_userq_reset() is unnecessary, so remove it to unify
> the compute userq reset.

The problem is that amdgpu_mes_detect_and_reset_hung_queues() won't
reset the queue in some cases.  Detect_and_reset() attempts to preempt
the queues and if they fail to preempt they are considered hung,
however, there are queues which can be preempted which are in a state
which won't make progress so the protected fence will never signal.
That's why we have this special case.

Alex

>
> Signed-off-by: Prike Liang <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c    | 5 -----
>  drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 2 --
>  2 files changed, 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index a6f95ff47d24..5c3be851ac84 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> @@ -2384,11 +2384,6 @@ int amdgpu_gfx_reset_mes_compute(struct amdgpu_device 
> *adev,
>                 deferred_end[n_deferred].fence = guilty_fence;
>                 n_deferred++;
>         }
> -       if (uq) {
> -               r = mes_userq_reset(uq);
> -               if (r)
> -                       goto out;
> -       }
>         for (i = 0; i < num_hung; i++) {
>                 struct amdgpu_ring *hr = NULL;
>                 struct amdgpu_fence *hf = NULL;
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c 
> b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
> index 7f334f718cd8..83a438d8e117 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
> @@ -249,8 +249,6 @@ int mes_userq_reset_queue(struct amdgpu_device *adev,
>
>         xa_for_each(&adev->userq_doorbell_xa, uq_id, uq) {
>                 if (uq->queue_type == queue_type) {
> -                       if (uq == guilty_uq)
> -                               continue;
>                         if (uq->doorbell_index == db) {
>                                 uq->state = AMDGPU_USERQ_STATE_HUNG;
>                                 if (use_mmio)
> --
> 2.34.1
>

Reply via email to