All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit
       [not found] <20191224050436.14641-1-Jack.Zhang1@amd.com>
@ 2019-12-24  5:05 ` Zhang, Jack (Jian)
  2019-12-26  2:57   ` Zhang, Jack (Jian)
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Jack (Jian) @ 2019-12-24  5:05 UTC (permalink / raw)
  To: Wang, Kevin(Yang), Feng, Kenneth, Quan, Evan, Zhang, Jack (Jian),
	amd-gfx



-----Original Message-----
From: Jack Zhang <Jack.Zhang1@amd.com> 
Sent: Tuesday, December 24, 2019 1:05 PM
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Jack (Jian) <Jack.Zhang1@amd.com>
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.

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 7781d24..ca877bd 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit
  2019-12-24  5:05 ` [PATCH] drm/amd/powerplay free driver_pptable for smu reinit Zhang, Jack (Jian)
@ 2019-12-26  2:57   ` Zhang, Jack (Jian)
  2019-12-26  8:07     ` Quan, Evan
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Jack (Jian) @ 2019-12-26  2:57 UTC (permalink / raw)
  To: Wang, Kevin(Yang), Feng, Kenneth, Quan, Evan, Zhang, Jack (Jian),
	amd-gfx

Ping...

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



-----Original Message-----
From: Jack Zhang <Jack.Zhang1@amd.com> 
Sent: Tuesday, December 24, 2019 1:05 PM
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Jack (Jian) <Jack.Zhang1@amd.com>
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.

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 7781d24..ca877bd 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit
  2019-12-26  2:57   ` Zhang, Jack (Jian)
@ 2019-12-26  8:07     ` Quan, Evan
  0 siblings, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2019-12-26  8:07 UTC (permalink / raw)
  To: Zhang, Jack (Jian), Wang, Kevin(Yang), Feng, Kenneth, amd-gfx

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
> -----Original Message-----
> From: Zhang, Jack (Jian) <Jack.Zhang1@amd.com>
> Sent: Thursday, December 26, 2019 10:58 AM
> To: Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; Feng, Kenneth
> <Kenneth.Feng@amd.com>; Quan, Evan <Evan.Quan@amd.com>; Zhang, Jack
> (Jian) <Jack.Zhang1@amd.com>; amd-gfx@lists.freedesktop.org
> 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) <Kevin1.Wang@amd.com>; Feng, Kenneth
> <Kenneth.Feng@amd.com>; Quan, Evan <Evan.Quan@amd.com>; Jack Zhang
> <Jack.Zhang1@amd.com>; amd-gfx@lists.freedesktop.org
> Subject: RE: [PATCH] drm/amd/powerplay free driver_pptable for smu reinit
> 
> 
> 
> -----Original Message-----
> From: Jack Zhang <Jack.Zhang1@amd.com>
> Sent: Tuesday, December 24, 2019 1:05 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Zhang, Jack (Jian) <Jack.Zhang1@amd.com>
> 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.
> 
> Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> index 7781d24..ca877bd 100644
> --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> @@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-26  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191224050436.14641-1-Jack.Zhang1@amd.com>
2019-12-24  5:05 ` [PATCH] drm/amd/powerplay free driver_pptable for smu reinit Zhang, Jack (Jian)
2019-12-26  2:57   ` Zhang, Jack (Jian)
2019-12-26  8:07     ` Quan, Evan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.