drm/amdgpu: Fix race condition in amdgpu_mn_unregister
authorFelix Kuehling <Felix.Kuehling@amd.com>
Tue, 16 Feb 2016 20:29:23 +0000 (15:29 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 17 Feb 2016 21:10:42 +0000 (16:10 -0500)
commitb8ea3783467586246d0b2b08f2e3f42853219d94
tree4eb5c6f1a9bc517209f2e8bd3429df6f5503a922
parent418aa0c296ddb5df90c4e94f995cfd3f3c9e96dc
drm/amdgpu: Fix race condition in amdgpu_mn_unregister

Exchange locking order of adev->mn_lock and mm_sem, so that
rmn->mm->mmap_sem can be taken safely, protected by adev->mn_lock,
when amdgpu_mn_destroy runs concurrently.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c