aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-11 05:35:08 -0500
committerDave Airlie <airlied@redhat.com>2013-12-17 20:41:55 -0500
commit43d1337cbe087ed24ffceadfd5ac311b6a0e4bfa (patch)
treebc6daab9923b7b1f174d2ac80eaa70067537d1be
parentb8673b648ad5443e00fa07a4104d0d64855d2ca0 (diff)
drm: rip out dev->ioctl_count tracking
Now dev->ioctl_count tries to prevent the device from disappearing if it's still in use. And if we'd actually need this code it would be hopelessly racy and broken. But luckily the vfs already takes care of this. So we can just rip it out. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_drv.c2
-rw-r--r--drivers/gpu/drm/drm_fops.c8
-rw-r--r--include/drm/drmP.h1
3 files changed, 1 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index d9137e49c4e8..9fd4dd476d33 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -315,7 +315,6 @@ long drm_ioctl(struct file *filp,
315 if (drm_device_is_unplugged(dev)) 315 if (drm_device_is_unplugged(dev))
316 return -ENODEV; 316 return -ENODEV;
317 317
318 atomic_inc(&dev->ioctl_count);
319 ++file_priv->ioctl_count; 318 ++file_priv->ioctl_count;
320 319
321 if ((nr >= DRM_CORE_IOCTL_COUNT) && 320 if ((nr >= DRM_CORE_IOCTL_COUNT) &&
@@ -410,7 +409,6 @@ long drm_ioctl(struct file *filp,
410 409
411 if (kdata != stack_kdata) 410 if (kdata != stack_kdata)
412 kfree(kdata); 411 kfree(kdata);
413 atomic_dec(&dev->ioctl_count);
414 if (retcode) 412 if (retcode)
415 DRM_DEBUG("ret = %d\n", retcode); 413 DRM_DEBUG("ret = %d\n", retcode);
416 return retcode; 414 return retcode;
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index c5b929c3f77a..97ebc828de5b 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -392,7 +392,6 @@ static void drm_legacy_dev_reinit(struct drm_device *dev)
392 if (drm_core_check_feature(dev, DRIVER_MODESET)) 392 if (drm_core_check_feature(dev, DRIVER_MODESET))
393 return; 393 return;
394 394
395 atomic_set(&dev->ioctl_count, 0);
396 atomic_set(&dev->vma_count, 0); 395 atomic_set(&dev->vma_count, 0);
397 396
398 dev->sigdata.lock = NULL; 397 dev->sigdata.lock = NULL;
@@ -578,12 +577,7 @@ int drm_release(struct inode *inode, struct file *filp)
578 */ 577 */
579 578
580 if (!--dev->open_count) { 579 if (!--dev->open_count) {
581 if (atomic_read(&dev->ioctl_count)) { 580 retcode = drm_lastclose(dev);
582 DRM_ERROR("Device busy: %d\n",
583 atomic_read(&dev->ioctl_count));
584 retcode = -EBUSY;
585 } else
586 retcode = drm_lastclose(dev);
587 if (drm_device_is_unplugged(dev)) 581 if (drm_device_is_unplugged(dev))
588 drm_put_dev(dev); 582 drm_put_dev(dev);
589 } 583 }
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index c34a2cc2d9b6..0670857b1420 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1110,7 +1110,6 @@ struct drm_device {
1110 /** \name Usage Counters */ 1110 /** \name Usage Counters */
1111 /*@{ */ 1111 /*@{ */
1112 int open_count; /**< Outstanding files open */ 1112 int open_count; /**< Outstanding files open */
1113 atomic_t ioctl_count; /**< Outstanding IOCTLs pending */
1114 atomic_t vma_count; /**< Outstanding vma areas open */ 1113 atomic_t vma_count; /**< Outstanding vma areas open */
1115 int buf_use; /**< Buffers in use -- cannot alloc */ 1114 int buf_use; /**< Buffers in use -- cannot alloc */
1116 atomic_t buf_alloc; /**< Buffer allocation in progress */ 1115 atomic_t buf_alloc; /**< Buffer allocation in progress */