drm - Fix a second X lockup w/radeon ttm
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 15 Jan 2015 20:59:51 +0000 (12:59 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 15 Jan 2015 20:59:51 +0000 (12:59 -0800)
commit5fd16c59eed4b0560ae53e41715827f3a1309036
tree4b86a42b5eed6c88e3c906e9baad09ad4527ef4d
parent4cad922272de275c8a4153e91f926d828d134452
drm - Fix a second X lockup w/radeon ttm

* Code which releases bo->reserved and wakes up waiters was
  not interlocked against wait_event_common() used to wait
  for the release.  This can result in a race where the
  release occurs inbetween the wait's test and its sleep,
  preventing the wait from ever waking up.

* This is different from the recent dev_pager_mtx deadlock which
  was recently fixed, but in the same code path.

* Roll the release of bo->reserved into a static function
  and throw the bo->event_queue.lock around the actual
  release to fix the race.
sys/dev/drm/ttm/ttm_bo.c