Skip to contentSkip to conversation

drm/amdgpu/swsmu/smu12: fix force clock handling for mclk

PATCH In review Alex Deucher 2 participants 2 messages Sep 28, 2020 – Sep 29, 2020

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

PATCH 1/1 drm/amdgpu/swsmu/smu12: fix force clock handling for mclk

The state array is in the reverse order compared to other asics (high to low rather than low to high).

---
 drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +5 -3
index 55a254be5ac2..66c1026489be 100644
@@ -222,14 +222,16 @@ static int renoir_get_profiling_clk_mask(struct smu_context *smu,
 			*sclk_mask = 0;
 	} else if (level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK) {
 		if (mclk_mask)
-			*mclk_mask = 0;
+			/* mclk levels are in reverse order */
+			*mclk_mask = NUM_MEMCLK_DPM_LEVELS - 1;
 	} else if (level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK) {
 		if(sclk_mask)
 			/* The sclk as gfxclk and has three level about max/min/current */
 			*sclk_mask = 3 - 1;
 
 		if(mclk_mask)
-			*mclk_mask = NUM_MEMCLK_DPM_LEVELS - 1;
+			/* mclk levels are in reverse order */
+			*mclk_mask = 0;
 
 		if(soc_mask)
 			*soc_mask = NUM_SOCCLK_DPM_LEVELS - 1;
@@ -323,7 +325,7 @@ static int renoir_get_dpm_ultimate_freq(struct smu_context *smu,
 		case SMU_UCLK:
 		case SMU_FCLK:
 		case SMU_MCLK:
-			ret = renoir_get_dpm_clk_limited(smu, clk_type, 0, min);
+			ret = renoir_get_dpm_clk_limited(smu, clk_type, NUM_MEMCLK_DPM_LEVELS - 1, min);
 			if (ret)
 				goto failed;
 			break;
Signature · 6 lines
2.25.4

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

[AMD Official Use Only - Internal Distribution Only]

Thanks,
Prike

Quoted 65 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, September 29, 2020 2:19 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/swsmu/smu12: fix force clock handling for mclk

The state array is in the reverse order compared to other asics (high to low rather than low to high).

Bug:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitla
b.freedesktop.org%2Fdrm%2Famd%2F- %2Fissues%2F1313&amp;data=02%7C01%7CPrike.Liang%40amd.com%7C15f 59da6951546dbea4808d863dafba6%7C3dd8961fe4884e608e11a82d994e183 d%7C0%7C0%7C637369139485609967&amp;sdata=8QG%2FcFh8K3t7BT%2Ft cZJt6KqYOYxQVX9dblyzebY4rFc%3D&amp;reserved=0

---
 drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +2 -1
index 55a254be5ac2..66c1026489be 100644
@@ -222,14 +222,16 @@ static int renoir_get_profiling_clk_mask(struct
 smu_context *smu,
 *sclk_mask = 0;
 } else if (level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK) {
 if (mclk_mask)
-*mclk_mask = 0;
+/* mclk levels are in reverse order */
+*mclk_mask = NUM_MEMCLK_DPM_LEVELS - 1;
 } else if (level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK) {
 if(sclk_mask)
 /* The sclk as gfxclk and has three level about

max/min/current */
*sclk_mask = 3 - 1;

if(mclk_mask)

drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +2 -1
-*mclk_mask = NUM_MEMCLK_DPM_LEVELS - 1;
+/* mclk levels are in reverse order */
+*mclk_mask = 0;
 
 if(soc_mask)
 *soc_mask = NUM_SOCCLK_DPM_LEVELS - 1; @@ -

323,7 +325,7 @@ static int renoir_get_dpm_ultimate_freq(struct smu_context *smu,
case SMU_UCLK:
case SMU_FCLK:
case SMU_MCLK:
-ret = renoir_get_dpm_clk_limited(smu, clk_type, 0, min);

drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +2 -1
+ret = renoir_get_dpm_clk_limited(smu, clk_type,
+NUM_MEMCLK_DPM_LEVELS - 1, min);
 if (ret)
 goto failed;
 break;
--

2.25.4

Quoted 9 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.f
reedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7CPrike.Liang%40amd.com%7C15f59da6951546db ea4808d863dafba6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C 637369139485609967&amp;sdata=kH8rL1yy2JAGfJcsVdKfIP5wVjWMW%2Bp NLOLSuZssGh0%3D&amp;reserved=0

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