drm/ttm: Fixed a read/write lock imbalance
authorThomas Hellstrom <thellstrom@vmware.com>
Fri, 20 Nov 2015 19:43:50 +0000 (11:43 -0800)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 26 Nov 2015 14:47:38 +0000 (15:47 +0100)
In ttm_write_lock(), the uninterruptible path should call
__ttm_write_lock() not __ttm_read_lock().  This fixes a vmwgfx hang
on F23 start up.

syeh: Extracted this from one of Thomas' internal patches.

Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/ttm/ttm_lock.c

index 6a954544727f3f13cfa8d9be0b8ff4cbf39d9367..f154fb1929bd18e300e226d8fe89925b9e8b3754 100644 (file)
@@ -180,7 +180,7 @@ int ttm_write_lock(struct ttm_lock *lock, bool interruptible)
                        spin_unlock(&lock->lock);
                }
        } else
-               wait_event(lock->queue, __ttm_read_lock(lock));
+               wait_event(lock->queue, __ttm_write_lock(lock));
 
        return ret;
 }