Skip to contentSkip to conversation

drm/radeon: only warn once in radeon_ttm_bo_destroy if va list not empty

PATCH Superseded Julien Isorce 2 participants 2 messages Apr 27, 2017 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: only warn once in radeon_ttm_bo_destroy if va list not empty

But always print an error.

Encountered a dozen of exact same backtraces when mesa's pb_cache_release_all_buffers is called after that a gpu reset failed.

An other approach would be to check rdev->vm_manager.enabled instead of rdev->accel_working in the other function radeon_gem_object_close. But it will only work if the vm_manager succeeded to be re-enabled after a gpu reset.

---
 drivers/gpu/drm/radeon/radeon_object.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_object.c +7 -1
index bec2ec0..76cc039 100644
@@ -81,7 +81,13 @@ static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo)
 	list_del_init(&bo->list);
 	mutex_unlock(&bo->rdev->gem.mutex);
 	radeon_bo_clear_surface_reg(bo);
-	WARN_ON(!list_empty(&bo->va));
+
+	if (!list_empty(&bo->va)) {
+		DRM_ERROR("Virtual address list not empty, accel: %d\n",
+			  bo->rdev->accel_working);
+		WARN_ON_ONCE(1);
+	}
+
 	drm_gem_object_release(&bo->gem_base);
 	kfree(bo);
 }
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1493290719-22473-1-git-send-email-jisorce-bXq66PvbRDbQT0dZR+AlfA@public.gmane.org

#2 lore raw

Am 27.04.2017 um 12:58 schrieb Julien Isorce:

Quoted 23 lines

But always print an error.

Encountered a dozen of exact same backtraces when mesa's pb_cache_release_all_buffers is called after that a gpu reset failed.

An other approach would be to check rdev->vm_manager.enabled instead of rdev->accel_working in the other function radeon_gem_object_close. But it will only work if the vm_manager succeeded to be re-enabled after a gpu reset.

---
  drivers/gpu/drm/radeon/radeon_object.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_object.c +0 -0
index bec2ec0..76cc039 100644
@@ -81,7 +81,13 @@ static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo)
  	list_del_init(&bo->list);

drivers/gpu/drm/radeon/radeon_object.c static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo) · line 90

Quoted 10 lines
drivers/gpu/drm/radeon/radeon_object.c +7 -1
  	mutex_unlock(&bo->rdev->gem.mutex);
  	radeon_bo_clear_surface_reg(bo);
-	WARN_ON(!list_empty(&bo->va));
+
+	if (!list_empty(&bo->va)) {
+		DRM_ERROR("Virtual address list not empty, accel: %d\n",
+			  bo->rdev->accel_working);
+		WARN_ON_ONCE(1);
+	}
+

The message is superfluous if we initially started up the GPU and found later that we can't get GFX working again after a GPU reset it is pretty much impossible to continue.

I would just change the "WARN_ON(!list_empty(&bo->va));" to a "WARN_ON_ONCE(!list_empty(&bo->va));".

Regards,
Christian.

drivers/gpu/drm/radeon/radeon_object.c static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo) · line 93

Quoted 3 lines
drivers/gpu/drm/radeon/radeon_object.c +0 -0
  	drm_gem_object_release(&bo->gem_base);
  	kfree(bo);
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx