OSDN Git Service

drm/amdkfd: avoid HMM change cause circular lock
authorPhilip Yang <Philip.Yang@amd.com>
Wed, 5 Dec 2018 19:03:43 +0000 (14:03 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:21:01 +0000 (12:21 -0500)
commit89cd9d23e9a74d94f0db5bbbaf2ef1f6ede36ae5
tree9f046a94d4a043b1cf5beddcb1b0e27395156912
parent2c5a51f57042f9d686d72b96a41eb81dbfb86a64
drm/amdkfd: avoid HMM change cause circular lock

There is circular lock between gfx and kfd path with HMM change:
lock(dqm) -> bo::reserve -> amdgpu_mn_lock

To avoid this, move init/unint_mqd() out of lock(dqm), to remove nested
locking between mmap_sem and bo::reserve. The locking order
is: bo::reserve -> amdgpu_mn_lock(p->mn)

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c