Skip to contentSkip to conversation

free the metadata buffer for sg type BOs as well

PATCH In review Shiwu Zhang 3 participants 4 messages May 26, 2021 – May 28, 2021

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

PATCH 1/1 free the metadata buffer for sg type BOs as well

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
index 2d876e1eaa7c..e9f8701fd046 100644
@@ -95,7 +95,7 @@ static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo)
 	}
 	amdgpu_bo_unref(&bo->parent);
 
-	if (bo->tbo.type == ttm_bo_type_device) {
+	if (bo->tbo.type != ttm_bo_type_kernel) {
 		ubo = to_amdgpu_bo_user(bo);
 		kfree(ubo->metadata);
 	}
Signature · 6 lines
2.17.1

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

[AMD Official Use Only]

Please add a commit message as well.

With that, this is Acked-by: Nirmoy Das <[email protected]> but Christian should review it as well.

Nirmoy
-----Original Message-----
From: Zhang, Morris <[email protected]>
Sent: Wednesday, May 26, 2021 5:46 AM
To: [email protected]; Das, Nirmoy <[email protected]>
Subject: [PATCH] free the metadata buffer for sg type BOs as well

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
index 2d876e1eaa7c..e9f8701fd046 100644
@@ -95,7 +95,7 @@ static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo)
 	}
 	amdgpu_bo_unref(&bo->parent);
 
-	if (bo->tbo.type == ttm_bo_type_device) {
+	if (bo->tbo.type != ttm_bo_type_kernel) {
 		ubo = to_amdgpu_bo_user(bo);
 		kfree(ubo->metadata);
 	}
Signature · 5 lines
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to Shiwu Zhang

You need a commit message.

Am 26.05.21 um 05:46 schrieb Shiwu Zhang:

Quoted 1 line

With that fixed the patch is Reviewed-by: Christian König <[email protected]>

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
index 2d876e1eaa7c..e9f8701fd046 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo) · line 101

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
@@ -95,7 +95,7 @@ static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo)
  	}
  	amdgpu_bo_unref(&bo->parent);
 
-	if (bo->tbo.type == ttm_bo_type_device) {
+	if (bo->tbo.type != ttm_bo_type_kernel) {
  		ubo = to_amdgpu_bo_user(bo);
  		kfree(ubo->metadata);
  	}

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

#3 lore raw

[AMD Official Use Only - Internal Distribution Only]

Hi Das&Christian,

Merged.
Thanks you both for the comments.

--Brs,
Morris Zhang
MLSE Linux ML SRDC
Ext. 25147

-----Original Message-----
From: Christian König <[email protected]>
Sent: Wednesday, May 26, 2021 8:44 PM
To: Zhang, Morris <[email protected]>; [email protected]; Das, Nirmoy <[email protected]>
Subject: Re: [PATCH] free the metadata buffer for sg type BOs as well

You need a commit message.

Am 26.05.21 um 05:46 schrieb Shiwu Zhang:

Quoted 1 line

With that fixed the patch is Reviewed-by: Christian König <[email protected]>

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
index 2d876e1eaa7c..e9f8701fd046 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo) · line 101

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
@@ -95,7 +95,7 @@ static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo)
  	}
  	amdgpu_bo_unref(&bo->parent);
 
-	if (bo->tbo.type == ttm_bo_type_device) {
+	if (bo->tbo.type != ttm_bo_type_kernel) {
  		ubo = to_amdgpu_bo_user(bo);
  		kfree(ubo->metadata);
  	}

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