drm/amdgpu: Fix call trace warning and hang when removing amdgpu device
authorjsg <jsg@openbsd.org>
Fri, 31 Mar 2023 01:53:07 +0000 (01:53 +0000)
committerjsg <jsg@openbsd.org>
Fri, 31 Mar 2023 01:53:07 +0000 (01:53 +0000)
From lyndonli
f06b902511ea05526f405ee64da54a8313d91831 in linux-6.1.y/6.1.22
93bb18d2a873d2fa9625c8ea927723660a868b95 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c

index edc3cbd..2c1285b 100644 (file)
@@ -1335,7 +1335,7 @@ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)
 
        if (!bo->resource || bo->resource->mem_type != TTM_PL_VRAM ||
            !(abo->flags & AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE) ||
-           adev->in_suspend || adev->shutdown)
+           adev->in_suspend || drm_dev_is_unplugged(adev_to_drm(adev)))
                return;
 
        if (WARN_ON_ONCE(!dma_resv_trylock(bo->base.resv)))