diff options
author | Christian König <christian.koenig@amd.com> | 2017-09-03 09:22:06 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-12 14:24:00 -0400 |
commit | b72cf4fca2bb786e20864b5e8755105aa9626fb4 (patch) | |
tree | 0f3f739d3fdbe0b8c2a7510689f8fdf482da295d /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | 862095237c392887819e98018d6dc187d8c78726 (diff) |
drm/amdgpu: move taking mmap_sem into get_user_pages v2
This didn't helped as intended, just simplify the code.
v2: unlock mmap_sem in the error path as well
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index f1e61b3df640..b0d45c8e6bb3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |||
@@ -318,8 +318,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, | |||
318 | } | 318 | } |
319 | 319 | ||
320 | if (args->flags & AMDGPU_GEM_USERPTR_VALIDATE) { | 320 | if (args->flags & AMDGPU_GEM_USERPTR_VALIDATE) { |
321 | down_read(¤t->mm->mmap_sem); | ||
322 | |||
323 | r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm, | 321 | r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm, |
324 | bo->tbo.ttm->pages); | 322 | bo->tbo.ttm->pages); |
325 | if (r) | 323 | if (r) |
@@ -334,8 +332,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, | |||
334 | amdgpu_bo_unreserve(bo); | 332 | amdgpu_bo_unreserve(bo); |
335 | if (r) | 333 | if (r) |
336 | goto free_pages; | 334 | goto free_pages; |
337 | |||
338 | up_read(¤t->mm->mmap_sem); | ||
339 | } | 335 | } |
340 | 336 | ||
341 | r = drm_gem_handle_create(filp, gobj, &handle); | 337 | r = drm_gem_handle_create(filp, gobj, &handle); |