drm/amdkfd: Fix lock dependency warning with srcu
authorjsg <jsg@openbsd.org>
Tue, 6 Feb 2024 03:53:15 +0000 (03:53 +0000)
committerjsg <jsg@openbsd.org>
Tue, 6 Feb 2024 03:53:15 +0000 (03:53 +0000)
From Philip Yang
752312f6a79440086ac0f9b08d7776870037323c in linux-6.6.y/6.6.16
2a9de42e8d3c82c6990d226198602be44f43f340 in mainline linux

sys/dev/pci/drm/amd/amdkfd/kfd_svm.c

index a4c911f..b51224a 100644 (file)
@@ -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);
        }