diff options
author | Dave Airlie <airlied@redhat.com> | 2018-06-20 16:57:41 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-06-20 16:58:31 +1000 |
commit | 4216c1b9aff68b99c139d4a2d4c9aae9c1b77274 (patch) | |
tree | 079e02eaf33fb9da1b528df670692b3578d3cfdc /drivers/gpu | |
parent | 845876a086c9077a96ec8782c4d1313a59b75790 (diff) | |
parent | 069035c5db3459b9b5f12caf3bffed9a863fa5c4 (diff) | |
download | op-kernel-dev-4216c1b9aff68b99c139d4a2d4c9aae9c1b77274.zip op-kernel-dev-4216c1b9aff68b99c139d4a2d4c9aae9c1b77274.tar.gz |
Merge tag 'drm-misc-next-fixes-2018-06-15' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Single fix for v4.18:
- Fix possible race conditions while unplugging DRM device.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1fd8b7d1-e60a-0105-dfb5-d36f99ea0239@linux.intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index b553a6f..7af748e 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -369,13 +369,6 @@ EXPORT_SYMBOL(drm_dev_exit); */ void drm_dev_unplug(struct drm_device *dev) { - drm_dev_unregister(dev); - - mutex_lock(&drm_global_mutex); - if (dev->open_count == 0) - drm_dev_put(dev); - mutex_unlock(&drm_global_mutex); - /* * After synchronizing any critical read section is guaranteed to see * the new value of ->unplugged, and any critical section which might @@ -384,6 +377,13 @@ void drm_dev_unplug(struct drm_device *dev) */ dev->unplugged = true; synchronize_srcu(&drm_unplug_srcu); + + drm_dev_unregister(dev); + + mutex_lock(&drm_global_mutex); + if (dev->open_count == 0) + drm_dev_put(dev); + mutex_unlock(&drm_global_mutex); } EXPORT_SYMBOL(drm_dev_unplug); |