Skip to contentSkip to conversation

drm/amd/powerplay free driver_pptable for smu reinit

PATCH Zhang, Jack (Jian) 2 participants 3 messages Dec 24, 2019 – Dec 26, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Tuesday, December 24, 2019 1:05 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit

During gpu recover, smu hw reinit will fail becasue table_context->driver_pptable is not freed and set to NULL.

Free the driver_pptable pointer if it's not NULL.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +4 -2
index 7781d24..ca877bd 100644
@@ -713,8 +713,10 @@ int smu_v11_0_parse_pptable(struct smu_context *smu)
 	struct smu_table_context *table_context = &smu->smu_table;
 	struct smu_table *table = &table_context->tables[SMU_TABLE_PPTABLE];
 
-	if (table_context->driver_pptable)
-		return -EINVAL;
+	if (table_context->driver_pptable) {
+		kfree(table_context->driver_pptable);
+		table_context->driver_pptable = NULL;
+	}
 
 	table_context->driver_pptable = kzalloc(table->size, GFP_KERNEL);
 

--
2.7.4

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

#2 lore raw

Ping...

-----Original Message-----
From: Zhang, Jack (Jian)
Sent: Tuesday, December 24, 2019 1:05 PM
To: Wang, Kevin(Yang) <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Jack Zhang <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Tuesday, December 24, 2019 1:05 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit

During gpu recover, smu hw reinit will fail becasue table_context->driver_pptable is not freed and set to NULL.

Free the driver_pptable pointer if it's not NULL.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +4 -2
index 7781d24..ca877bd 100644
@@ -713,8 +713,10 @@ int smu_v11_0_parse_pptable(struct smu_context *smu)
 	struct smu_table_context *table_context = &smu->smu_table;
 	struct smu_table *table = &table_context->tables[SMU_TABLE_PPTABLE];
 
-	if (table_context->driver_pptable)
-		return -EINVAL;
+	if (table_context->driver_pptable) {
+		kfree(table_context->driver_pptable);
+		table_context->driver_pptable = NULL;
+	}
 
 	table_context->driver_pptable = kzalloc(table->size, GFP_KERNEL);
 

--
2.7.4

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

#3 lore raw

As I know, the smu hw reinit is not on the path of gpu recover. Can you help me understand the use case?

Regards,
Evan

Quoted 57 lines

-----Original Message-----
From: Zhang, Jack (Jian) <[email protected]>
Sent: Thursday, December 26, 2019 10:58 AM
To: Wang, Kevin(Yang) <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Zhang, Jack (Jian) <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit

Ping...

-----Original Message-----
From: Zhang, Jack (Jian)
Sent: Tuesday, December 24, 2019 1:05 PM
To: Wang, Kevin(Yang) <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Jack Zhang <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Tuesday, December 24, 2019 1:05 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit

During gpu recover, smu hw reinit will fail becasue table_context-

Quoted 1 line

driver_pptable is not freed and set to NULL.

Free the driver_pptable pointer if it's not NULL.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +4 -2
index 7781d24..ca877bd 100644
@@ -713,8 +713,10 @@ int smu_v11_0_parse_pptable(struct smu_context
 *smu)
 	struct smu_table_context *table_context = &smu->smu_table;
 	struct smu_table *table = &table_context-
 >tables[SMU_TABLE_PPTABLE];
 
-	if (table_context->driver_pptable)
-		return -EINVAL;
+	if (table_context->driver_pptable) {
+		kfree(table_context->driver_pptable);
+		table_context->driver_pptable = NULL;
+	}
 

table_context->driver_pptable = kzalloc(table->size, GFP_KERNEL);

Quoted 2 lines

--
2.7.4

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