Skip to contentSkip to conversation

drm/amdgpu: Correct the condition of warning while bo release

PATCH In review xinhui pan 3 participants 3 messages Mar 9, 2020

Subsystems (2)
lore
Share & tools
lore

xinhui pan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Correct the condition of warning while bo release

Only kernel bo has kfd eviction fence.
This warning is to give a notice that kfd only remove eviction fence on individual bos.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
index 5766d20f29d8..e99f68af2bf7 100644
@@ -1308,7 +1308,8 @@ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)
 		amdgpu_amdkfd_unreserve_memory_limit(abo);
 
 	/* We only remove the fence if the resv has individualized. */
-	WARN_ON_ONCE(bo->base.resv != &bo->base._resv);
+	WARN_ON_ONCE(bo->type == ttm_bo_type_kernel
+			&& bo->base.resv != &bo->base._resv);
 	if (bo->base.resv == &bo->base._resv)
 		amdgpu_amdkfd_remove_fence_on_pt_pd_bos(abo);
 
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 09.03.20 um 15:34 schrieb xinhui pan:

Quoted 5 lines

Only kernel bo has kfd eviction fence.
This warning is to give a notice that kfd only remove eviction fence on individual bos.

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
index 5766d20f29d8..e99f68af2bf7 100644
@@ -1308,7 +1308,8 @@ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)
  		amdgpu_amdkfd_unreserve_memory_limit(abo);
 
  	/* We only remove the fence if the resv has individualized. */
-	WARN_ON_ONCE(bo->base.resv != &bo->base._resv);
+	WARN_ON_ONCE(bo->type == ttm_bo_type_kernel
+			&& bo->base.resv != &bo->base._resv);
  	if (bo->base.resv == &bo->base._resv)
  		amdgpu_amdkfd_remove_fence_on_pt_pd_bos(abo);
 
#2 lore raw
Quoted 8 lines · Christian König

Am 09.03.20 um 15:34 schrieb xinhui pan:

Quoted 5 lines

Only kernel bo has kfd eviction fence.
This warning is to give a notice that kfd only remove eviction fence on individual bos.

If applicable (I reported but was not the first to report / you were already aware):

The warning went away when applied.

Cheers!

Quoted 18 lines
Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
index 5766d20f29d8..e99f68af2bf7 100644
@@ -1308,7 +1308,8 @@ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)
  		amdgpu_amdkfd_unreserve_memory_limit(abo);
  	/* We only remove the fence if the resv has individualized. */
-	WARN_ON_ONCE(bo->base.resv != &bo->base._resv);
+	WARN_ON_ONCE(bo->type == ttm_bo_type_kernel
+			&& bo->base.resv != &bo->base._resv);
  	if (bo->base.resv == &bo->base._resv)
  		amdgpu_amdkfd_remove_fence_on_pt_pd_bos(abo);