drm/amdkfd: Fix sdma queue allocate race condition
authorOak Zeng <Oak.Zeng@amd.com>
Thu, 6 Jun 2019 18:19:06 +0000 (13:19 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Jun 2019 17:57:18 +0000 (12:57 -0500)
commitf77dac6cd62e5d4bcadd740620af1218bfb54cc6
tree6967d9f4ca95c2d04a80fa905d7c68a628758371
parent06b89b38f3cc518a761164f9f958a9607bbb3587
drm/amdkfd: Fix sdma queue allocate race condition

SDMA queue allocation requires the dqm lock at it modify
the global dqm members. Move up the dqm_lock so sdma
queue allocation is enclosed in the critical section. Move
mqd allocation out of critical section to avoid circular
lock dependency.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c