diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 221b924..f462979 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -28,6 +28,7 @@ * Authors: Thomas Hellstrom */ +#include #include #include #include @@ -110,6 +111,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) retval = VM_FAULT_NOPAGE; goto out_unlock; default: + DRM_ERROR("Driver fault_reserve_notify hook returned %d\n", ret); retval = VM_FAULT_SIGBUS; goto out_unlock; } @@ -125,6 +127,8 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) ret = ttm_bo_wait(bo, false, true, false); spin_unlock(&bdev->fence_lock); if (unlikely(ret != 0)) { + if (ret != -ERESTARTSYS) + DRM_ERROR("ttm_bo_wait returned %d\n", ret); retval = (ret != -ERESTARTSYS) ? VM_FAULT_SIGBUS : VM_FAULT_NOPAGE; goto out_unlock; @@ -139,6 +143,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) } ret = ttm_mem_io_reserve_vm(bo); if (unlikely(ret != 0)) { + DRM_ERROR("ttm_mem_io_reserve_vm returned %d\n", ret); retval = VM_FAULT_SIGBUS; goto out_io_unlock; } @@ -149,6 +154,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) bo->vm_node->start - vma->vm_pgoff; if (unlikely(page_offset >= bo->num_pages)) { + DRM_ERROR("page_offset=%lu >= bo->num_pages=%lu\n", page_offset, bo->num_pages); retval = VM_FAULT_SIGBUS; goto out_io_unlock; } @@ -204,6 +210,8 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) if (unlikely((ret == -EBUSY) || (ret != 0 && i > 0))) break; else if (unlikely(ret != 0)) { + if (ret != -ENOMEM) + DRM_ERROR("vm_insert_mixed returned %d\n", ret); retval = (ret == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS; goto out_io_unlock;