Skip to content

Commit 43d1337

Browse files
danvetairlied
authored andcommitted
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>
1 parent b8673b6 commit 43d1337

3 files changed

Lines changed: 1 addition & 10 deletions

File tree

‎drivers/gpu/drm/drm_drv.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ long drm_ioctl(struct file *filp,
315315
if (drm_device_is_unplugged(dev))
316316
return -ENODEV;
317317

318-
atomic_inc(&dev->ioctl_count);
319318
++file_priv->ioctl_count;
320319

321320
if ((nr >= DRM_CORE_IOCTL_COUNT) &&
@@ -410,7 +409,6 @@ long drm_ioctl(struct file *filp,
410409

411410
if (kdata != stack_kdata)
412411
kfree(kdata);
413-
atomic_dec(&dev->ioctl_count);
414412
if (retcode)
415413
DRM_DEBUG("ret = %d\n", retcode);
416414
return retcode;

‎drivers/gpu/drm/drm_fops.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ static void drm_legacy_dev_reinit(struct drm_device *dev)
392392
if (drm_core_check_feature(dev, DRIVER_MODESET))
393393
return;
394394

395-
atomic_set(&dev->ioctl_count, 0);
396395
atomic_set(&dev->vma_count, 0);
397396

398397
dev->sigdata.lock = NULL;
@@ -578,12 +577,7 @@ int drm_release(struct inode *inode, struct file *filp)
578577
*/
579578

580579
if (!--dev->open_count) {
581-
if (atomic_read(&dev->ioctl_count)) {
582-
DRM_ERROR("Device busy: %d\n",
583-
atomic_read(&dev->ioctl_count));
584-
retcode = -EBUSY;
585-
} else
586-
retcode = drm_lastclose(dev);
580+
retcode = drm_lastclose(dev);
587581
if (drm_device_is_unplugged(dev))
588582
drm_put_dev(dev);
589583
}

‎include/drm/drmP.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,6 @@ struct drm_device {
11101110
/** \name Usage Counters */
11111111
/*@{ */
11121112
int open_count; /**< Outstanding files open */
1113-
atomic_t ioctl_count; /**< Outstanding IOCTLs pending */
11141113
atomic_t vma_count; /**< Outstanding vma areas open */
11151114
int buf_use; /**< Buffers in use -- cannot alloc */
11161115
atomic_t buf_alloc; /**< Buffer allocation in progress */

0 commit comments

Comments
 (0)