Skip to contentSkip to conversation

drm/amd/powerplay: fix memory leakage when reload

PATCH In review Yintian Tao 3 participants 5 messages Jan 1, 2018 – Jan 4, 2018 3 messages not in the archive

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

PATCH 1/1 drm/amd/powerplay: fix memory leakage when reload

add smu_free_memory when smu fini to prevent memory leakage

Change-Id Id9103d8b54869b63f22a9af53d9fbc3b7a221191
---
 drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +6 -0
index c49a6f2..925217e 100644
@@ -607,6 +607,12 @@ int smu7_init(struct pp_smumgr *smumgr)
 
 int smu7_smu_fini(struct pp_smumgr *smumgr)
 {
+	struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(smumgr->backend);
+
+	smu_free_memory(smumgr->device, smu_data->header_buffer.handle);
+	if (!cgs_is_virtualization_enabled(smumgr->device))
+		smu_free_memory(smumgr->device, smu_data->smu_buffer.handle);
+
 	if (smumgr->backend) {
 		kfree(smumgr->backend);
 		smumgr->backend = NULL;
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): 1514776580-17052-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Yintian Tao <[email protected]>
Sent: Sunday, December 31, 2017 10:16 PM
To: [email protected]
Cc: Tao, Yintian
Subject: [PATCH] drm/amd/powerplay: fix memory leakage when reload

add smu_free_memory when smu fini to prevent memory leakage

Change-Id Id9103d8b54869b63f22a9af53d9fbc3b7a221191

Looks like vega10, cz, rv have the same issue can you send patches for them as well?

Thanks,

Alex

---
 drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +6 -0
index c49a6f2..925217e 100644
@@ -607,6 +607,12 @@ int smu7_init(struct pp_smumgr *smumgr)
 
 int smu7_smu_fini(struct pp_smumgr *smumgr)
 {
+       struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(smumgr->backend);
+
+       smu_free_memory(smumgr->device, smu_data->header_buffer.handle);
+       if (!cgs_is_virtualization_enabled(smumgr->device))
+               smu_free_memory(smumgr->device, smu_data->smu_buffer.handle);
+
         if (smumgr->backend) {
                 kfree(smumgr->backend);
                 smumgr->backend = NULL;

--
2.7.4

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

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

#3 lore raw
In reply to a message not in the archive

Add Alex

-----Original Message-----
From: Yintian Tao [mailto:[email protected]]
Sent: Monday, January 01, 2018 11:16 AM
To: [email protected]
Cc: Tao, Yintian <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix memory leakage when reload

add smu_free_memory when smu fini to prevent memory leakage

Change-Id Id9103d8b54869b63f22a9af53d9fbc3b7a221191
---
 drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +7 -1
index c49a6f2..925217e 100644
@@ -607,6 +607,12 @@ int smu7_init(struct pp_smumgr *smumgr)
 
 int smu7_smu_fini(struct pp_smumgr *smumgr)  {
+	struct smu7_smumgr *smu_data = (struct smu7_smumgr 
+*)(smumgr->backend);
+
+	smu_free_memory(smumgr->device, smu_data->header_buffer.handle);
+	if (!cgs_is_virtualization_enabled(smumgr->device))
+		smu_free_memory(smumgr->device, smu_data->smu_buffer.handle);
+
 	if (smumgr->backend) {
 		kfree(smumgr->backend);
 		smumgr->backend = NULL;
--

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): DM3PR1201MB1040AD31CDCD1F1ECA34329CE51E0-BBcFnVpqZhWvVYYlwACKW2rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]

#5 lore raw

Did you see my reply yesterday? I reviewed it. I also think we need to fix up cz, rv, and vg10.

________________________________
From: Tao, Yintian
Sent: Tuesday, January 2, 2018 9:22:23 PM
To: Tao, Yintian; [email protected]; Deucher, Alexander
Subject: RE: [PATCH] drm/amd/powerplay: fix memory leakage when reload

Add Alex

-----Original Message-----
From: Yintian Tao [mailto:[email protected]]
Sent: Monday, January 01, 2018 11:16 AM
To: [email protected]
Cc: Tao, Yintian <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix memory leakage when reload

add smu_free_memory when smu fini to prevent memory leakage

Change-Id Id9103d8b54869b63f22a9af53d9fbc3b7a221191
---
 drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +7 -1
index c49a6f2..925217e 100644
@@ -607,6 +607,12 @@ int smu7_init(struct pp_smumgr *smumgr)
 
 int smu7_smu_fini(struct pp_smumgr *smumgr)  {
+       struct smu7_smumgr *smu_data = (struct smu7_smumgr
+*)(smumgr->backend);
+
+       smu_free_memory(smumgr->device, smu_data->header_buffer.handle);
+       if (!cgs_is_virtualization_enabled(smumgr->device))
+               smu_free_memory(smumgr->device, smu_data->smu_buffer.handle);
+
         if (smumgr->backend) {
                 kfree(smumgr->backend);
                 smumgr->backend = NULL;
--

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): BN6PR12MB1652DDD5B775B8D64A2E42E1F71E0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#7 lore raw

Hi Alex

Thanks a lot. I got it.

Best Regards
Yintian Tao

From: Deucher, Alexander
Sent: Wednesday, January 03, 2018 10:32 PM
To: Tao, Yintian <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/powerplay: fix memory leakage when reload

Did you see my reply yesterday? I reviewed it. I also think we need to fix up cz, rv, and vg10.

________________________________
From: Tao, Yintian
Sent: Tuesday, January 2, 2018 9:22:23 PM
To: Tao, Yintian; [email protected]<mailto:[email protected]>; Deucher, Alexander
Subject: RE: [PATCH] drm/amd/powerplay: fix memory leakage when reload

Add Alex

-----Original Message-----
From: Yintian Tao [mailto:[email protected]]
Sent: Monday, January 01, 2018 11:16 AM
To: [email protected]<mailto:[email protected]>
Cc: Tao, Yintian <[email protected]<mailto:[email protected]>>
Subject: [PATCH] drm/amd/powerplay: fix memory leakage when reload

add smu_free_memory when smu fini to prevent memory leakage

Change-Id Id9103d8b54869b63f22a9af53d9fbc3b7a221191
---
 drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +7 -1
index c49a6f2..925217e 100644
@@ -607,6 +607,12 @@ int smu7_init(struct pp_smumgr *smumgr)
 
 int smu7_smu_fini(struct pp_smumgr *smumgr)  {
+       struct smu7_smumgr *smu_data = (struct smu7_smumgr
+*)(smumgr->backend);
+
+       smu_free_memory(smumgr->device, smu_data->header_buffer.handle);
+       if (!cgs_is_virtualization_enabled(smumgr->device))
+               smu_free_memory(smumgr->device, smu_data->smu_buffer.handle);
+
         if (smumgr->backend) {
                 kfree(smumgr->backend);
                 smumgr->backend = NULL;
--

2.7.4

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