drm/amdgpu: add to custom amdgpu_drm_release drm_dev_enter/exit
Subsystems (2)
PATCH 1/1 drm/amdgpu: add to custom amdgpu_drm_release drm_dev_enter/exit
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).
Signed-off-by Vitaly Prosyak <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -1
@@ -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);
Signature · 1 line
2.34.1