diff options
author | Christian König <christian.koenig@amd.com> | 2016-02-23 06:36:59 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-03-08 11:01:50 -0500 |
commit | 2f568dbd6b944c2e8c0c54b53c2211c23995e6a4 (patch) | |
tree | 385cdb8bc9d264b40e9f83e6e89440b867866c07 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | d564a06e1c9c285bab1c1579c18c811aa1271884 (diff) |
drm/amdgpu: move get_user_pages out of amdgpu_ttm_tt_pin_userptr v6
That avoids lock inversion between the BO reservation lock
and the anon_vma lock.
v2:
* Changed amdgpu_bo_list_entry.user_pages to an array of pointers
* Lock mmap_sem only for get_user_pages
* Added invalidation of unbound userpointer BOs
* Fixed memory leak and page reference leak
v3 (chk):
* Revert locking mmap_sem only for_get user_pages
* Revert adding invalidation of unbound userpointer BOs
* Sanitize and fix error handling
v4 (chk):
* Init userpages pointer everywhere.
* Fix error handling when get_user_pages() fails.
* Add invalidation of unbound userpointer BOs again.
v5 (chk):
* Add maximum number of tries.
v6 (chk):
* Fix error handling when we run out of tries.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> (v4)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index a0896c761108..cc967b44f104 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -95,6 +95,7 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, | |||
95 | entry->priority = 0; | 95 | entry->priority = 0; |
96 | entry->tv.bo = &vm->page_directory->tbo; | 96 | entry->tv.bo = &vm->page_directory->tbo; |
97 | entry->tv.shared = true; | 97 | entry->tv.shared = true; |
98 | entry->user_pages = NULL; | ||
98 | list_add(&entry->tv.head, validated); | 99 | list_add(&entry->tv.head, validated); |
99 | } | 100 | } |
100 | 101 | ||
@@ -1186,6 +1187,7 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev, | |||
1186 | entry->priority = 0; | 1187 | entry->priority = 0; |
1187 | entry->tv.bo = &entry->robj->tbo; | 1188 | entry->tv.bo = &entry->robj->tbo; |
1188 | entry->tv.shared = true; | 1189 | entry->tv.shared = true; |
1190 | entry->user_pages = NULL; | ||
1189 | vm->page_tables[pt_idx].addr = 0; | 1191 | vm->page_tables[pt_idx].addr = 0; |
1190 | } | 1192 | } |
1191 | 1193 | ||