drm - Fix lock order reversal
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 19 Nov 2016 05:55:50 +0000 (21:55 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 19 Nov 2016 05:55:50 +0000 (21:55 -0800)
commit8ee19f911cc1a8fa496a55fbb3d4e3749cc1363f
tree82b71af853686ffd0ea5aa5b735fb4b39ad10244
parent717e3e506d2520325a09b250998f20a5dc1a1132
drm - Fix lock order reversal

* Lock order reversal caused by holding dev_pager_mtx() across
  the object->un_pager.devp.ops->cdev_pg_dtor() call.  devpgr -> drmslk.

* Move the lock from before to after the call.  Holding the mutex shouldn't
  be necessary across the call.  This also fixes the reversal as devpgr is
  no longer held across the call.

* Fixes a lock order reversal against drm_ioctl() which obtains drmslk first
  and recurses into a device pager operation which gets devpgr.

* Fix a few other incidental bugs that would normally not be triggered by
  the DRM code due to outer locks held by the DRM code.  Plus some formatting
  fixes.
sys/vm/device_pager.c