drm/amdkfd: Don't take process mutex for svm ioctls
authorPhilip Yang <Philip.Yang@amd.com>
Mon, 24 Jan 2022 21:40:44 +0000 (16:40 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:02:58 +0000 (20:02 +0200)
commitbb3cd7fa3ecd64a9a4192595b33ad92a357568ed
tree1584ce3804a73d6eeeac0eac73773e9b24d34141
parent1d229668354363f807a9664e4d2efa3c4789b4bd
drm/amdkfd: Don't take process mutex for svm ioctls

[ Upstream commit ac7c48c0cce00d03b3c95fddcccb0a45257e33e3 ]

SVM ioctls take proper svms->lock to handle race conditions, don't need
take process mutex to serialize ioctls. This also fixes circular locking
warning:

WARNING: possible circular locking dependency detected

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock((work_completion)(&svms->deferred_list_work));
                                lock(&process->mutex);
                     lock((work_completion)(&svms->deferred_list_work));
   lock(&process->mutex);

   *** DEADLOCK ***

Signed-off-by: Philip Yang <Philip.Yang@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_chardev.c