From: jsg Date: Tue, 6 Feb 2024 03:53:15 +0000 (+0000) Subject: drm/amdkfd: Fix lock dependency warning with srcu X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6ba23f6e8a4aedef84ddc2226579d8bc979dc50c;p=openbsd drm/amdkfd: Fix lock dependency warning with srcu From Philip Yang 752312f6a79440086ac0f9b08d7776870037323c in linux-6.6.y/6.6.16 2a9de42e8d3c82c6990d226198602be44f43f340 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_svm.c b/sys/dev/pci/drm/amd/amdkfd/kfd_svm.c index a4c911fa167..b51224a85a3 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_svm.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_svm.c @@ -2343,8 +2343,10 @@ retry: mutex_unlock(&svms->lock); mmap_write_unlock(mm); - /* Pairs with mmget in svm_range_add_list_work */ - mmput(mm); + /* Pairs with mmget in svm_range_add_list_work. If dropping the + * last mm refcount, schedule release work to avoid circular locking + */ + mmput_async(mm); spin_lock(&svms->deferred_list_lock); }