aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0831-drm-amdgpu-Fix-oops-with-multi-threaded-userptr-regi.patch
blob: 52e2b8bfbc43d6d71cda5455706b6b935f136b1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 1ef5ab18f3d4bbb6eff60f39531a6c99d4e78e8a Mon Sep 17 00:00:00 2001
From: Felix Kuehling <Felix.Kuehling@amd.com>
Date: Fri, 8 Apr 2016 00:04:58 -0400
Subject: [PATCH 0831/4131] drm/amdgpu: Fix oops with multi-threaded userptr
 registration

In the amdgpu_ttm_tt structure, remember the task group's leader
instead of the current thread. The current thread can exit during
the life time of the BO, the group leader should remain valid for
the life time of the MM struct and the BO.

Change-Id: I16a77521ec15fdf39a0f684d3f5cdba07a3b4a61
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 8ec6d92..f90503d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1041,7 +1041,7 @@ int amdgpu_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr,
 		return -EINVAL;
 
 	gtt->userptr = addr;
-	gtt->usertask = current;
+	gtt->usertask = current->group_leader;
 	gtt->userflags = flags;
 	spin_lock_init(&gtt->guptasklock);
 	INIT_LIST_HEAD(&gtt->guptasks);
-- 
2.7.4