Skip to contentSkip to conversation

drm/amd/pm: Disable fan control if not supported

PATCH In review Lijo Lazar 2 participants 2 messages Oct 22, 2021

Subsystems (3)
lore
Share & tools
lore

Lijo Lazar

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Disable fan control if not supported

On arcturus, not all platforms use PMFW based fan control. On such ASICs fan control by PMFW will be disabled in PPTable. Disable hwmon knobs for fan control also as it is not possible to report or control fan speed on such platforms through driver.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +14 -0
index 082f01893f3d..fd1d30a93db5 100644
@@ -436,6 +436,19 @@ static void arcturus_check_bxco_support(struct smu_context *smu)
 	}
 }
 
+static void arcturus_check_fan_support(struct smu_context *smu)
+{
+	struct smu_table_context *table_context = &smu->smu_table;
+	PPTable_t *pptable = table_context->driver_pptable;
+
+	/* No sort of fan control possible if PPTable has it disabled */
+	smu->adev->pm.no_fan =
+		!(pptable->FeaturesToRun[0] & FEATURE_FAN_CONTROL_MASK);
+	if (smu->adev->pm.no_fan)
+		dev_info_once(smu->adev->dev,
+			      "PMFW based fan control disabled");
+}
+
 static int arcturus_check_powerplay_table(struct smu_context *smu)
 {
 	struct smu_table_context *table_context = &smu->smu_table;
@@ -443,6 +456,7 @@ static int arcturus_check_powerplay_table(struct smu_context *smu)
 		table_context->power_play_table;
 
 	arcturus_check_bxco_support(smu);
+	arcturus_check_fan_support(smu);
 
 	table_context->thermal_controller_type =
 		powerplay_table->thermal_controller_type;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Lijo Lazar

On arcturus, not all platforms use PMFW based fan control. On such ASICs fan control by PMFW will be disabled in PPTable. Disable hwmon knobs for fan control also as it is not possible to report or control fan speed on such platforms through driver.

Quoted 39 lines
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +14 -1
index 082f01893f3d..fd1d30a93db5 100644
@@ -436,6 +436,19 @@ static void arcturus_check_bxco_support(struct smu_context *smu)
        }
 }
 
+static void arcturus_check_fan_support(struct smu_context *smu)
+{
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *pptable = table_context->driver_pptable;
+
+       /* No sort of fan control possible if PPTable has it disabled */
+       smu->adev->pm.no_fan =
+               !(pptable->FeaturesToRun[0] & FEATURE_FAN_CONTROL_MASK);
+       if (smu->adev->pm.no_fan)
+               dev_info_once(smu->adev->dev,
+                             "PMFW based fan control disabled");
+}
+
 static int arcturus_check_powerplay_table(struct smu_context *smu)
 {
        struct smu_table_context *table_context = &smu->smu_table;
@@ -443,6 +456,7 @@ static int arcturus_check_powerplay_table(struct smu_context *smu)
                table_context->power_play_table;
 
        arcturus_check_bxco_support(smu);
+       arcturus_check_fan_support(smu);
 
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;
--

2.17.1