From: jsg Date: Thu, 14 Apr 2022 08:40:39 +0000 (+0000) Subject: drm/amdgpu: Fix recursive locking warning X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=eb62d9deb76dda287d4dbff936583e9ec1ebf91d;p=openbsd drm/amdgpu: Fix recursive locking warning From Rajneesh Bhardwaj 0a922366d6d9b2532344b3763a54090ab9b50f59 in linux 5.15.y/5.15.34 447c7997b62a5115ba4da846dcdee4fc12298a6a in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c index 69ca34012bc..4959b60c5f8 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c @@ -1361,7 +1361,8 @@ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo) !(abo->flags & AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE)) return; - dma_resv_lock(bo->base.resv, NULL); + if (WARN_ON_ONCE(!dma_resv_trylock(bo->base.resv))) + return; r = amdgpu_fill_buffer(abo, AMDGPU_POISON, bo->base.resv, &fence); if (!WARN_ON(r)) {