From 1ef5ab18f3d4bbb6eff60f39531a6c99d4e78e8a Mon Sep 17 00:00:00 2001 From: Felix Kuehling 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 --- 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(>t->guptasklock); INIT_LIST_HEAD(>t->guptasks); -- 2.7.4