Skip to contentSkip to conversation

drm/amd/pm: support runtime pptable update for sienna_cichlid etc.

PATCH In review Jiansong Chen 4 participants 5 messages Sep 14, 2020

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

PATCH 1/1 drm/amd/pm: support runtime pptable update for sienna_cichlid etc.

This avoids smu issue when enabling runtime pptable update for sienna_cichlid and so on. Runtime pptable udpate is needed for test and debug purpose.

Change-Id I70b704ab4d6efd169f579c392e5dbc2737dc1fb2
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +9 -3
index 7a55ece1f124..7618f9972b8c 100644
@@ -1129,7 +1129,7 @@ static int smu_disable_dpms(struct smu_context *smu)
 	 */
 	if (smu->uploading_custom_pp_table &&
 	    (adev->asic_type >= CHIP_NAVI10) &&
-	    (adev->asic_type <= CHIP_NAVI12))
+	    (adev->asic_type <= CHIP_NAVY_FLOUNDER))
 		return 0;
 
 	/*
@@ -1214,7 +1214,9 @@ static int smu_hw_fini(void *handle)
 int smu_reset(struct smu_context *smu)
 {
 	struct amdgpu_device *adev = smu->adev;
-	int ret = 0;
+	int ret;
+
+	amdgpu_gfx_off_ctrl(smu->adev, false);
 
 	ret = smu_hw_fini(adev);
 	if (ret)
@@ -1225,8 +1227,12 @@ int smu_reset(struct smu_context *smu)
 		return ret;
 
 	ret = smu_late_init(adev);
+	if (ret)
+		return ret;
 
-	return ret;
+	amdgpu_gfx_off_ctrl(smu->adev, true);
+
+	return 0;
 }
 
 static int smu_suspend(void *handle)
Signature · 6 lines
2.25.1

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

[AMD Official Use Only - Internal Distribution Only]

-----Original Message-----
From: Jiansong Chen <[email protected]>
Sent: Monday, September 14, 2020 4:10 PM
To: [email protected]
Cc: Zhou1, Tao <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Chen, Jiansong (Simon) <[email protected]>
Subject: [PATCH] drm/amd/pm: support runtime pptable update for sienna_cichlid etc.

This avoids smu issue when enabling runtime pptable update for sienna_cichlid and so on. Runtime pptable udpate is needed for test and debug purpose.

Change-Id I70b704ab4d6efd169f579c392e5dbc2737dc1fb2
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +9 -3
index 7a55ece1f124..7618f9972b8c 100644
@@ -1129,7 +1129,7 @@ static int smu_disable_dpms(struct smu_context *smu)
 	 */
 	if (smu->uploading_custom_pp_table &&
 	    (adev->asic_type >= CHIP_NAVI10) &&
-	    (adev->asic_type <= CHIP_NAVI12))
+	    (adev->asic_type <= CHIP_NAVY_FLOUNDER))
 		return 0;
 
 	/*
@@ -1214,7 +1214,9 @@ static int smu_hw_fini(void *handle)  int smu_reset(struct smu_context *smu)  {
 	struct amdgpu_device *adev = smu->adev;
-	int ret = 0;
+	int ret;
+
+	amdgpu_gfx_off_ctrl(smu->adev, false);
 
 	ret = smu_hw_fini(adev);
 	if (ret)
@@ -1225,8 +1227,12 @@ int smu_reset(struct smu_context *smu)
 		return ret;
 
 	ret = smu_late_init(adev);
+	if (ret)
+		return ret;
 
-	return ret;
+	amdgpu_gfx_off_ctrl(smu->adev, true);
+
+	return 0;
 }
 
 static int smu_suspend(void *handle)

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

#2 lore raw
In reply to Jiansong Chen

[AMD Public Use]

ret = smu_late_init(adev);
+ if (ret)
+ return ret;

One counter leak happens? It needs to call amdgpu_gfx_off_ctrl(smu->adev, true) before returning?

Regards,
Guchun

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jiansong Chen
Sent: Monday, September 14, 2020 4:10 PM
To: [email protected]
Cc: Zhou1, Tao <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Chen, Jiansong (Simon) <[email protected]>
Subject: [PATCH] drm/amd/pm: support runtime pptable update for sienna_cichlid etc.

This avoids smu issue when enabling runtime pptable update for sienna_cichlid and so on. Runtime pptable udpate is needed for test and debug purpose.

Change-Id I70b704ab4d6efd169f579c392e5dbc2737dc1fb2
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +9 -3
index 7a55ece1f124..7618f9972b8c 100644
@@ -1129,7 +1129,7 @@ static int smu_disable_dpms(struct smu_context *smu)
 	 */
 	if (smu->uploading_custom_pp_table &&
 	    (adev->asic_type >= CHIP_NAVI10) &&
-	    (adev->asic_type <= CHIP_NAVI12))
+	    (adev->asic_type <= CHIP_NAVY_FLOUNDER))
 		return 0;
 
 	/*
@@ -1214,7 +1214,9 @@ static int smu_hw_fini(void *handle)  int smu_reset(struct smu_context *smu)  {
 	struct amdgpu_device *adev = smu->adev;
-	int ret = 0;
+	int ret;
+
+	amdgpu_gfx_off_ctrl(smu->adev, false);
 
 	ret = smu_hw_fini(adev);
 	if (ret)
@@ -1225,8 +1227,12 @@ int smu_reset(struct smu_context *smu)
 		return ret;
 
 	ret = smu_late_init(adev);
+	if (ret)
+		return ret;
 
-	return ret;
+	amdgpu_gfx_off_ctrl(smu->adev, true);
+
+	return 0;
 }
 
 static int smu_suspend(void *handle)

--
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cguchun.chen%40amd.com%7Cd73dd73ccf3c444c710508d858859f53%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637356678262125090&amp;sdata=p0sqrDLhD4vaNesLHIq6Jfd57sAeu8wHDH69bDwTAvA%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw

It makes nonsense to call gfxoff when smu failure has happened.

Regards,
Jiansong
-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Monday, September 14, 2020 4:14 PM
To: Chen, Jiansong (Simon) <[email protected]>; [email protected]
Cc: Zhou1, Tao <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Chen, Jiansong (Simon) <[email protected]>
Subject: RE: [PATCH] drm/amd/pm: support runtime pptable update for sienna_cichlid etc.

[AMD Public Use]

ret = smu_late_init(adev);
+ if (ret)
+ return ret;

One counter leak happens? It needs to call amdgpu_gfx_off_ctrl(smu->adev, true) before returning?

Regards,
Guchun

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jiansong Chen
Sent: Monday, September 14, 2020 4:10 PM
To: [email protected]
Cc: Zhou1, Tao <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Chen, Jiansong (Simon) <[email protected]>
Subject: [PATCH] drm/amd/pm: support runtime pptable update for sienna_cichlid etc.

This avoids smu issue when enabling runtime pptable update for sienna_cichlid and so on. Runtime pptable udpate is needed for test and debug purpose.

Change-Id I70b704ab4d6efd169f579c392e5dbc2737dc1fb2
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +9 -3
index 7a55ece1f124..7618f9972b8c 100644
@@ -1129,7 +1129,7 @@ static int smu_disable_dpms(struct smu_context *smu)
 	 */
 	if (smu->uploading_custom_pp_table &&
 	    (adev->asic_type >= CHIP_NAVI10) &&
-	    (adev->asic_type <= CHIP_NAVI12))
+	    (adev->asic_type <= CHIP_NAVY_FLOUNDER))
 		return 0;
 
 	/*
@@ -1214,7 +1214,9 @@ static int smu_hw_fini(void *handle)  int smu_reset(struct smu_context *smu)  {
 	struct amdgpu_device *adev = smu->adev;
-	int ret = 0;
+	int ret;
+
+	amdgpu_gfx_off_ctrl(smu->adev, false);
 
 	ret = smu_hw_fini(adev);
 	if (ret)
@@ -1225,8 +1227,12 @@ int smu_reset(struct smu_context *smu)
 		return ret;
 
 	ret = smu_late_init(adev);
+	if (ret)
+		return ret;
 
-	return ret;
+	amdgpu_gfx_off_ctrl(smu->adev, true);
+
+	return 0;
 }
 
 static int smu_suspend(void *handle)

--
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cguchun.chen%40amd.com%7Cd73dd73ccf3c444c710508d858859f53%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637356678262125090&amp;sdata=p0sqrDLhD4vaNesLHIq6Jfd57sAeu8wHDH69bDwTAvA%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw
In reply to Jiansong Chen

[AMD Official Use Only - Internal Distribution Only]

Better to split this into two patches: one for the dpm disablement skipping and another for gfxoff ctrl. Either way this patch is reviewed-by: Evan Quan <[email protected]>

-----Original Message-----
From: Jiansong Chen <[email protected]>
Sent: Monday, September 14, 2020 4:10 PM
To: [email protected]
Cc: Zhou1, Tao <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Chen, Jiansong (Simon) <[email protected]>
Subject: [PATCH] drm/amd/pm: support runtime pptable update for sienna_cichlid etc.

This avoids smu issue when enabling runtime pptable update for sienna_cichlid and so on. Runtime pptable udpate is needed for test and debug purpose.

Change-Id I70b704ab4d6efd169f579c392e5dbc2737dc1fb2
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +9 -3
index 7a55ece1f124..7618f9972b8c 100644
@@ -1129,7 +1129,7 @@ static int smu_disable_dpms(struct smu_context *smu)
  */
 if (smu->uploading_custom_pp_table &&
     (adev->asic_type >= CHIP_NAVI10) &&
-    (adev->asic_type <= CHIP_NAVI12))
+    (adev->asic_type <= CHIP_NAVY_FLOUNDER))
 return 0;
 
 /*
@@ -1214,7 +1214,9 @@ static int smu_hw_fini(void *handle)
 int smu_reset(struct smu_context *smu)
 {
 struct amdgpu_device *adev = smu->adev;
-int ret = 0;
+int ret;
+
+amdgpu_gfx_off_ctrl(smu->adev, false);
 
 ret = smu_hw_fini(adev);
 if (ret)
@@ -1225,8 +1227,12 @@ int smu_reset(struct smu_context *smu)
 return ret;
 
 ret = smu_late_init(adev);
+if (ret)
+return ret;
 
-return ret;
+amdgpu_gfx_off_ctrl(smu->adev, true);
+
+return 0;
 }
 
 static int smu_suspend(void *handle)

--
2.25.1

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