@@ -46,7 +46,6 @@
#include <linux/file.h>
#include <linux/module.h>
-#define TTM_ASSERT_LOCKED(param)
#define TTM_DEBUG(fmt, arg...)
#define TTM_BO_HASH_ORDER 13
@@ -306,9 +305,6 @@ void ttm_bo_unreserve(struct ttm_buffer_object *bo)
}
EXPORT_SYMBOL(ttm_bo_unreserve);
-/*
- * Call bo->mutex locked.
- */
static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
{
struct ttm_bo_device *bdev = bo->bdev;
@@ -316,7 +312,7 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
int ret = 0;
uint32_t page_flags = 0;
- TTM_ASSERT_LOCKED(&bo->mutex);
+ BUG_ON(!atomic_read(&bo->reserved));
bo->ttm = NULL;
if (bdev->need_dma32)
@@ -146,7 +146,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
* since the mmap_sem is only held in read mode. However, we
* modify only the caching bits of vma->vm_page_prot and
* consider those bits protected by
- * the bo->mutex, as we should be the only writers.
+ * bo->reserved, as we should be the only writers.
* There shouldn't really be any readers of these bits except
* within vm_insert_mixed()? fork?
*
@@ -35,7 +35,6 @@
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/wait.h>
-#include <linux/mutex.h>
#include <linux/mm.h>
#include <linux/rbtree.h>
#include <linux/bitmap.h>
@@ -298,7 +297,7 @@ ttm_bo_reference(struct ttm_buffer_object *bo)
* @interruptible: Use interruptible wait.
* @no_wait: Return immediately if buffer is busy.
*
- * This function must be called with the bo::mutex held, and makes
+ * This function must be called with bo->reserved held, and makes
* sure any previous rendering to the buffer is completed.
* Note: It might be necessary to block validations before the
* wait by reserving the buffer.
@@ -37,6 +37,7 @@
#include "linux/workqueue.h"
#include "linux/fs.h"
#include "linux/spinlock.h"
+#include <linux/mutex.h>
struct ttm_backend;