drm/amdkfd: fix circular locking on get_wave_state
authorJonathan Kim <jonathan.kim@amd.com>
Fri, 11 Jun 2021 17:36:34 +0000 (13:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:50 +0000 (09:44 +0200)
commitcd29db48bb65e53efe4b05c75e575c5f1af5ddaf
tree17ebf65694c96d44c4058812296931595920034c
parent9d21abc8fd200f978a2ae51af59eb9eea091ce27
drm/amdkfd: fix circular locking on get_wave_state

[ Upstream commit 63f6e01237257e7226efc5087f3f0b525d320f54 ]

get_wave_state acquires the mmap_lock on copy_to_user but so do
mmu_notifiers.  mmu_notifiers allows dqm locking so do get_wave_state
outside the dqm_lock to prevent circular locking.

v2: squash in unused variable removal.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c