Skip to contentSkip to conversation

drm/amdgpu: unreserve the gem BO before returning from attach error

PATCH In review Prike Liang 2 participants 2 messages May 6, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: unreserve the gem BO before returning from attach error

It requires unlocking the reserved gem BO before returning from attaching the eviction fence error.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -0
index f03fc3cf4d50..2c68118fe9fd 100644
@@ -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;
 	}
 
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Prike Liang

It requires unlocking the reserved gem BO before returning from attaching the eviction fence error.

Quoted 16 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -0
index f03fc3cf4d50..2c68118fe9fd 100644
@@ -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;
 	}