summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_fops.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-02-24 18:53:25 +0400
committerDavid Herrmann <dh.herrmann@gmail.com>2014-03-16 15:54:21 +0400
commit0d639883ee26359e1bf38195df1dbca0f879e239 (patch)
tree6ff7b2284957af9efb3b7a3df3395d75c18cb366 /drivers/gpu/drm/drm_fops.c
parent7d86cf1a4fc0c0bdb6947185c6fe71301dfea7b1 (diff)
downloadlinux-0d639883ee26359e1bf38195df1dbca0f879e239.tar.xz
drm: make minors independent of global lock
We used to protect minor-lookup and setup by the global drm lock. To continue our attempts of dropping drm_global_mutex, this patch makes the minor management independent of it. Furthermore, we make it all atomic and switch to spin-locks instead of a mutex. Now that minor-lookup is independent, we also move the "drm_is_unplugged()" test into the minor-lookup path. There is no reason to ever return a minor for unplugged objects, so keep that logic internal. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/drm_fops.c')
-rw-r--r--drivers/gpu/drm/drm_fops.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 4ce5318d14bc..8f46fe273ba3 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -39,7 +39,7 @@
#include <linux/slab.h>
#include <linux/module.h>
-/* from BKL pushdown: note that nothing else serializes idr_find() */
+/* from BKL pushdown */
DEFINE_MUTEX(drm_global_mutex);
EXPORT_SYMBOL(drm_global_mutex);
@@ -91,11 +91,6 @@ int drm_open(struct inode *inode, struct file *filp)
return PTR_ERR(minor);
dev = minor->dev;
- if (drm_device_is_unplugged(dev)) {
- retcode = -ENODEV;
- goto err_release;
- }
-
if (!dev->open_count++)
need_setup = 1;
mutex_lock(&dev->struct_mutex);
@@ -127,7 +122,6 @@ err_undo:
dev->dev_mapping = old_mapping;
mutex_unlock(&dev->struct_mutex);
dev->open_count--;
-err_release:
drm_minor_release(minor);
return retcode;
}
@@ -157,9 +151,6 @@ int drm_stub_open(struct inode *inode, struct file *filp)
goto out_unlock;
dev = minor->dev;
- if (drm_device_is_unplugged(dev))
- goto out_release;
-
new_fops = fops_get(dev->driver->fops);
if (!new_fops)
goto out_release;