diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0839-drm-amdgpu-Simplify-process-termination-in-amdgpu_tt.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0839-drm-amdgpu-Simplify-process-termination-in-amdgpu_tt.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0839-drm-amdgpu-Simplify-process-termination-in-amdgpu_tt.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0839-drm-amdgpu-Simplify-process-termination-in-amdgpu_tt.patch new file mode 100644 index 00000000..dc3c6695 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0839-drm-amdgpu-Simplify-process-termination-in-amdgpu_tt.patch @@ -0,0 +1,45 @@ +From 298b1ba2e78b950e8ec03e655bd7102350d3e3b1 Mon Sep 17 00:00:00 2001 +From: Felix Kuehling <Felix.Kuehling@amd.com> +Date: Tue, 21 Mar 2017 12:05:18 -0400 +Subject: [PATCH 0839/4131] drm/amdgpu: Simplify process termination in + amdgpu_ttm_tt_get_user_pages + +Most of this is taken care of by the new userptr restore worker by +holding task and mm references when calling amdgpu_ttm_tt_get_user_pages. + +Change-Id: I0075e5ff997b7bc65f164e6d8bf84d43eb734092 +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +index f90503d..bb3cfe3 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +@@ -668,9 +668,13 @@ struct amdgpu_ttm_tt { + int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages) + { + struct amdgpu_ttm_tt *gtt = (void *)ttm; ++ struct mm_struct *mm = gtt->usertask->mm; + unsigned int flags = 0; + unsigned pinned = 0; + int r; ++ ++ if (!mm) /* Happens during process shutdown */ ++ return -ESRCH; + + if (!(gtt->userflags & AMDGPU_GEM_USERPTR_READONLY)) + flags |= FOLL_WRITE; +@@ -681,7 +685,7 @@ int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages) + unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE; + struct vm_area_struct *vma; + +- vma = find_vma(gtt->usertask->mm, gtt->userptr); ++ vma = find_vma(mm, gtt->userptr); + if (!vma || vma->vm_file || vma->vm_end < end) + return -EPERM; + } +-- +2.7.4 + |