On 08.08.25 00:04, [email protected] wrote:
> From: Vitaly Prosyak <[email protected]>
> 
> User queues are disabled before GEM objects are released
> (protecting against user app crashes).
> No races with PCI hot-unplug (because drm_dev_enter prevents cleanup
> if device is being removed).
> 
> Cc: Christian König <[email protected]>
> Cc: Alex Deucher <[email protected]>
> Signed-off-by: Vitaly Prosyak <[email protected]>

Reviewed-by: Christian König <[email protected]>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 4ff3a2eaaf55..32caaef522a1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -2920,11 +2920,14 @@ static int amdgpu_drm_release(struct inode *inode, 
> struct file *filp)
>  {
>       struct drm_file *file_priv = filp->private_data;
>       struct amdgpu_fpriv *fpriv = file_priv->driver_priv;
> +     struct drm_device *dev = file_priv->minor->dev;
> +     int idx;
>  
> -     if (fpriv) {
> +     if (fpriv && drm_dev_enter(dev, &idx)) {
>               fpriv->evf_mgr.fd_closing = true;
>               amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
>               amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
> +             drm_dev_exit(idx);
>       }
>  
>       return drm_release(inode, filp);

Reply via email to