]> Gentwo Git Trees - linux/.git/commitdiff
drm/amdgpu: use ttm_resource_manager_cleanup
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 21 Nov 2025 10:12:12 +0000 (11:12 +0100)
committerChristian König <christian.koenig@amd.com>
Wed, 26 Nov 2025 15:49:40 +0000 (16:49 +0100)
Rather than open-coding it.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20251121101315.3585-3-pierre-eric.pelloux-prayer@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 9777c5c9cb2677720af73ee0de46dc291f96392f..77f1f0d1593b1bb30e80b9d6d80e88b19f127930 100644 (file)
@@ -2193,8 +2193,10 @@ void amdgpu_ttm_set_buffer_funcs_status(struct amdgpu_device *adev, bool enable)
        } else {
                drm_sched_entity_destroy(&adev->mman.high_pr);
                drm_sched_entity_destroy(&adev->mman.low_pr);
-               dma_fence_put(man->move);
-               man->move = NULL;
+               /* Drop all the old fences since re-creating the scheduler entities
+                * will allocate new contexts.
+                */
+               ttm_resource_manager_cleanup(man);
        }
 
        /* this just adjusts TTM size idea, which sets lpfn to the correct value */