[PATCH v4 02/11] drm/amdgpu: validate unmap status for destroying userq
Liang, Prike
Prike.Liang at amd.com
Fri Jun 27 13:05:28 UTC 2025
[Public]
Regards,
Prike
> -----Original Message-----
> From: Koenig, Christian <Christian.Koenig at amd.com>
> Sent: Wednesday, June 25, 2025 3:59 PM
> To: Liang, Prike <Prike.Liang at amd.com>; amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
> Subject: Re: [PATCH v4 02/11] drm/amdgpu: validate unmap status for destroying
> userq
>
> On 24.06.25 10:45, Prike Liang wrote:
> > Before destroying the userq buffer object, it requires validating the
> > userq unmap status and ensuring the userq is unmapped from hardware.
>
> Hui, what is that supposed to be doing?
This change arms to validate the userq HW unmap result to see whether it is successful; if the user HW unmap failed, then it needs to reset the queue for reusing when the userq reset implementation lands. I will rework the commit log a bit, and as the failure is unlikely to happen, then I will add the unlikely() for the check condition.
Regards,
> Christian.
>
> >
> > Signed-off-by: Prike Liang <Prike.Liang at amd.com>
> > Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> > index 7f9dfeae4322..c7c9f9e597f1 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> > @@ -319,6 +319,11 @@ amdgpu_userq_destroy(struct drm_file *filp, int
> queue_id)
> > }
> > amdgpu_bo_unref(&queue->db_obj.obj);
> > r = amdgpu_userq_unmap_helper(uq_mgr, queue);
> > + /*TODO: It requires a reset for unmap error*/
> > + if (r != AMDGPU_USERQ_STATE_UNMAPPED) {
> > + drm_warn(adev_to_drm(uq_mgr->adev), "trying to destroy a HW
> mapping userq\n");
> > + r = -ETIMEDOUT;
> > + }
> > amdgpu_userq_cleanup(uq_mgr, queue, queue_id);
> > mutex_unlock(&uq_mgr->userq_mutex);
> >
More information about the amd-gfx
mailing list