Skip to contentSkip to conversation

drm/amdgpu/smu13: set the threshold for TEMP_HOTSPOT throttling

PATCH New Umio Yasuno 1 participant 1 message May 8, 2025

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

PATCH v2 1/1 drm/amdgpu/smu13: set the threshold for TEMP_HOTSPOT throttling

ThrottlingPercentage for TEMP_HOTSPOT on SMU v13.0.0/7 is almost always greater then or equal to 1. The THROTTLER_TEMP_HOTSPOT_BIT bit will be set even in idle states and some applications will continue to detect it. Therefore, set a threshold and make it work like any other throttling.

---
V1 -> V2: Decrease threshold to 80 and update description

---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c    | 13 ++++++++++---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c    | 13 ++++++++++---
 2 files changed, 20 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +10 -3
index 5a9711e8c..34b62eca4 100644
@@ -744,14 +744,21 @@ static int smu_v13_0_0_system_features_control(struct smu_context *smu,
 	return smu_v13_0_system_features_control(smu, en);
 }
 
+#define SMU_13_0_0_TEMP_HOTSPOT_THRESHOLD	80
 static uint32_t smu_v13_0_get_throttler_status(SmuMetrics_t *metrics)
 {
 	uint32_t throttler_status = 0;
 	int i;
 
-	for (i = 0; i < THROTTLER_COUNT; i++)
-		throttler_status |=
-			(metrics->ThrottlingPercentage[i] ? 1U << i : 0);
+	for (i = 0; i < THROTTLER_COUNT; i++) {
+		if(i == THROTTLER_TEMP_HOTSPOT_BIT) {
+			throttler_status |=
+				((metrics->ThrottlingPercentage[i] >= SMU_13_0_0_TEMP_HOTSPOT_THRESHOLD) ? 1U << i : 0);
+		} else {
+			throttler_status |=
+				(metrics->ThrottlingPercentage[i] ? 1U << i : 0);
+		}
+	}
 
 	return throttler_status;
 }
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +10 -3
index c8f4f6fb4..eb007cb37 100644
@@ -736,14 +736,21 @@ static bool smu_v13_0_7_is_dpm_running(struct smu_context *smu)
 	return !!(feature_enabled & SMC_DPM_FEATURE);
 }
 
+#define SMU_13_0_7_TEMP_HOTSPOT_THRESHOLD	80
 static uint32_t smu_v13_0_7_get_throttler_status(SmuMetrics_t *metrics)
 {
 	uint32_t throttler_status = 0;
 	int i;
 
-	for (i = 0; i < THROTTLER_COUNT; i++)
-		throttler_status |=
-			(metrics->ThrottlingPercentage[i] ? 1U << i : 0);
+	for (i = 0; i < THROTTLER_COUNT; i++) {
+		if(i == THROTTLER_TEMP_HOTSPOT_BIT) {
+			throttler_status |=
+				((metrics->ThrottlingPercentage[i] >= SMU_13_0_7_TEMP_HOTSPOT_THRESHOLD) ? 1U << i : 0);
+		} else {
+			throttler_status |=
+				(metrics->ThrottlingPercentage[i] ? 1U << i : 0);
+		}
+	}
 
 	return throttler_status;
 }
Signature · 1 line
2.39.5