diff options
author | Xiangliang.Yu <Xiangliang.Yu@amd.com> | 2017-10-20 05:21:40 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-11-21 10:44:26 -0500 |
commit | d5a480b44b189bad1d67df5d4c5ed9e6c750e8f2 (patch) | |
tree | cc0085cfdd62aea211fa91011154a0de1188a9fe /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | 135f971181d779c96ff3725c1a350a721785cc66 (diff) |
drm/amdgpu: fix kernel hang when starting VNC server
After starting VNC server or running CTS test, kernel will hang and
can see below call trace:
[961816] INFO: task khugepaged:42 blocked for more than 120 seconds.
[968581] Tainted: G OE 4.13.0 #1
[973495] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables
this message.
[980962] khugepaged D 0 42 2 0x00000000
[980967] Call Trace:
[980977] __schedule+0x28d/0x890
[980982] schedule+0x36/0x80
[980986] rwsem_down_read_failed+0x139/0x1c0
[980991] ? update_curr+0x100/0x1c0
[981004] call_rwsem_down_read_failed+0x18/0x30
[981007] down_read+0x20/0x40
[981012] khugepaged_scan_mm_slot+0x78/0x1ac0
[981018] ? __switch_to+0x23e/0x4a0
[981022] ? finish_task_switch+0x79/0x240
[981026] khugepaged+0x146/0x480
[981031] ? remove_wait_queue+0x60/0x60
[981035] kthread+0x109/0x140
[981037] ? khugepaged_scan_mm_slot+0x1ac0/0x1ac0
[981039] ? kthread_park+0x60/0x60
[981044] ret_from_fork+0x25/0x30
After checking code and found 'commit b72cf4fca2bb7 ("drm/amdgpu: move
taking mmap_sem into get_user_pages v2")' forget to drop one case of
up_read.
Signed-off-by: Xiangliang.Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Christian König <christian.koenig@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 | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 951d625bbdd7..14aff2f15a94 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |||
@@ -328,7 +328,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, | |||
328 | r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm, | 328 | r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm, |
329 | bo->tbo.ttm->pages); | 329 | bo->tbo.ttm->pages); |
330 | if (r) | 330 | if (r) |
331 | goto unlock_mmap_sem; | 331 | goto release_object; |
332 | 332 | ||
333 | r = amdgpu_bo_reserve(bo, true); | 333 | r = amdgpu_bo_reserve(bo, true); |
334 | if (r) | 334 | if (r) |
@@ -353,9 +353,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, | |||
353 | free_pages: | 353 | free_pages: |
354 | release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages, false); | 354 | release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages, false); |
355 | 355 | ||
356 | unlock_mmap_sem: | ||
357 | up_read(¤t->mm->mmap_sem); | ||
358 | |||
359 | release_object: | 356 | release_object: |
360 | drm_gem_object_put_unlocked(gobj); | 357 | drm_gem_object_put_unlocked(gobj); |
361 | 358 | ||