drm/amdgpu: unreserve the gem BO before returning from attach error
authorPrike Liang <Prike.Liang@amd.com>
Tue, 6 May 2025 08:32:23 +0000 (16:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 May 2025 21:44:59 +0000 (17:44 -0400)
It requires unlocking the reserved gem BO before returning from
attaching the eviction fence error.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index f03fc3cf4d50b854a22055ad6025c29db85a89eb..2c68118fe9fd6abc85e1c8872382af618322f6f6 100644 (file)
@@ -298,6 +298,7 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj,
        r = amdgpu_eviction_fence_attach(&fpriv->evf_mgr, abo);
        if (r) {
                DRM_DEBUG_DRIVER("Failed to attach eviction fence to BO\n");
+               amdgpu_bo_unreserve(abo);
                return r;
        }