drm - Fix panic on DRM_IOCTL_WAIT_VBLANK
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 27 Dec 2015 00:11:04 +0000 (16:11 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 27 Dec 2015 00:11:04 +0000 (16:11 -0800)
commit3256313cd10e4b39701aa9a9cf0aa4347dae42d8
treeec6516f773170b25c615589c2ba23ed4e20fc3c2
parent2c9916cd50d5c4c4defa089bebed8c8865efa896
drm - Fix panic on DRM_IOCTL_WAIT_VBLANK

* DRM_IOCTL_WAIT_VBLANK -> drm_wait_vblank() -> DRM_WAIT_ON() -> panic

  DRM_WAIT_ON() assumed that the device was locked and tried to unlock
  and relock it around the tsleep.  However, the ioctl paths that use
  this function do not lock the device.

* Remove the unlock/relock sequence.

* Tested on haswell using ioctl call w/vblank.request.type =
   _DRM_VBLANK_RELATIVE and vblank.request.sequence = 10.  Crash reproduced
   before fix, does not occur after fix.

Reported-by: arcade@b1t.name
sys/dev/drm/include/drm/drmP.h