]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: Fix circular lock in nocpsch path
authorAmber Lin <Amber.Lin@amd.com>
Mon, 7 Jun 2021 18:46:21 +0000 (14:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Jun 2021 21:25:42 +0000 (17:25 -0400)
commitc4553f7aad3331f179700d26e5db7c6a688edaca
treef4d542441346f99960cc2aa98aa03a4b481f1c25
parent7097a98f8cf4a034f725f9895735ab0238bcf1fc
drm/amdkfd: Fix circular lock in nocpsch path

Calling free_mqd inside of destroy_queue_nocpsch_locked can cause a
circular lock. destroy_queue_nocpsch_locked is called under a DQM lock,
which is taken in MMU notifiers, potentially in FS reclaim context.
Taking another lock, which is BO reservation lock from free_mqd, while
causing an FS reclaim inside the DQM lock creates a problematic circular
lock dependency. Therefore move free_mqd out of
destroy_queue_nocpsch_locked and call it after unlocking DQM.

Signed-off-by: Amber Lin <Amber.Lin@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