Displaying 2 results from an estimated 2 matches for "ioctls_need_rwsem".
2012 Apr 22
1
[PATCH 1/5] drm: add optional per device rwsem for all ioctls
..., 0 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 6116e3b..c54e9f8 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -464,6 +464,9 @@ long drm_ioctl(struct file *filp,
} else
memset(kdata, 0, usize);
+ if (dev->driver->ioctls_need_rwsem)
+ down_read(&dev->ioctls_rwsem);
+
if (ioctl->flags & DRM_UNLOCKED)
retcode = func(dev, kdata, file_priv);
else {
@@ -472,6 +475,9 @@ long drm_ioctl(struct file *filp,
mutex_unlock(&drm_global_mutex);
}
+ if (dev->driver->ioctls_need_rwsem)
+ up_read...
2012 Apr 22
2
[RFC PATCH 5/5] drm/nouveau: gpu lockup recovery
...t_in_progress(dev));
if (ret) {
NV_ERROR(dev, "... engine %d failed: %d\n", e, ret);
goto out_abort;
@@ -483,6 +483,7 @@ static struct drm_driver driver = {
.disable_vblank = nouveau_vblank_disable,
.reclaim_buffers = drm_core_reclaim_buffers,
.ioctls = nouveau_ioctls,
+ .ioctls_need_rwsem = true,
.fops = &nouveau_driver_fops,
.gem_init_object = nouveau_gem_object_new,
.gem_free_object = nouveau_gem_object_del,
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index d120baf..01500e1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h...