Merge v5.8-rc1 into drm-misc-fixes
[platform/kernel/linux-starfive.git] / drivers / gpu / drm / ttm / ttm_bo_vm.c
index 72100b8..fa03fab 100644 (file)
@@ -58,7 +58,7 @@ static vm_fault_t ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,
                goto out_clear;
 
        /*
-        * If possible, avoid waiting for GPU with mmap_sem
+        * If possible, avoid waiting for GPU with mmap_lock
         * held.  We only do this if the fault allows retry and this
         * is the first attempt.
         */
@@ -68,7 +68,7 @@ static vm_fault_t ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,
                        goto out_unlock;
 
                ttm_bo_get(bo);
-               up_read(&vmf->vma->vm_mm->mmap_sem);
+               mmap_read_unlock(vmf->vma->vm_mm);
                (void) dma_fence_wait(bo->moving, true);
                dma_resv_unlock(bo->base.resv);
                ttm_bo_put(bo);
@@ -131,20 +131,20 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
 {
        /*
         * Work around locking order reversal in fault / nopfn
-        * between mmap_sem and bo_reserve: Perform a trylock operation
+        * between mmap_lock and bo_reserve: Perform a trylock operation
         * for reserve, and if it fails, retry the fault after waiting
         * for the buffer to become unreserved.
         */
        if (unlikely(!dma_resv_trylock(bo->base.resv))) {
                /*
                 * If the fault allows retry and this is the first
-                * fault attempt, we try to release the mmap_sem
+                * fault attempt, we try to release the mmap_lock
                 * before waiting
                 */
                if (fault_flag_allow_retry_first(vmf->flags)) {
                        if (!(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) {
                                ttm_bo_get(bo);
-                               up_read(&vmf->vma->vm_mm->mmap_sem);
+                               mmap_read_unlock(vmf->vma->vm_mm);
                                if (!dma_resv_lock_interruptible(bo->base.resv,
                                                                 NULL))
                                        dma_resv_unlock(bo->base.resv);