Skip to contentSkip to conversation

drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0

PATCH In review Kenneth Feng 3 participants 5 messages Aug 9, 2023

Subsystems (3)
lore
Share & tools
lore

Kenneth Feng

author maintainer
#0 lore raw

PATCH v2 1/1 drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0

drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0
V2: depend on pm.no_fan to check

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +4 -0
index fddcd834bcec..0fb6be11a0cc 100644
@@ -331,6 +331,7 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
 	struct smu_13_0_0_powerplay_table *powerplay_table =
 		table_context->power_play_table;
 	struct smu_baco_context *smu_baco = &smu->smu_baco;
+	PPTable_t *pptable = smu->smu_table.driver_pptable;
 #if 0
 	PPTable_t *pptable = smu->smu_table.driver_pptable;
 	const OverDriveLimits_t * const overdrive_upperlimits =
@@ -371,6 +372,9 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
 	table_context->thermal_controller_type =
 		powerplay_table->thermal_controller_type;
 
+	smu->adev->pm.no_fan =
+		!(pptable->SkuTable.FeaturesToRun[0] & (1 << FEATURE_FAN_CONTROL_BIT));
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Kenneth Feng

drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0
V2: depend on pm.no_fan to check

You can still read the fan speed though right? Don't we want to just not expose the ability to manually set the fan speed?

Alex

Quoted 29 lines
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +4 -1
index fddcd834bcec..0fb6be11a0cc 100644
@@ -331,6 +331,7 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
        struct smu_13_0_0_powerplay_table *powerplay_table =
                table_context->power_play_table;
        struct smu_baco_context *smu_baco = &smu->smu_baco;
+       PPTable_t *pptable = smu->smu_table.driver_pptable;
 #if 0
        PPTable_t *pptable = smu->smu_table.driver_pptable;
        const OverDriveLimits_t * const overdrive_upperlimits =
@@ -371,6 +372,9 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;
 
+       smu->adev->pm.no_fan =
+               !(pptable->SkuTable.FeaturesToRun[0] & (1 << FEATURE_FAN_CONTROL_BIT));
+
        return 0;
 }
 
--

2.34.1

#2 lore raw
Quoted 9 lines · Alex Deucher
Quoted 5 lines · Kenneth Feng

drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0
V2: depend on pm.no_fan to check

You can still read the fan speed though right? Don't we want to just not expose the ability to manually set the fan speed?

If PMFW is not controlling fan, there is no guarantee that the cooling solution (any other external one) is using GPU's fan controller itself. In that way, reading the speed from controller doesn't make sense.

Thanks,
Lijo

Quoted 32 lines

Alex

Quoted 29 lines
---
  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +4 -1
index fddcd834bcec..0fb6be11a0cc 100644
@@ -331,6 +331,7 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
         struct smu_13_0_0_powerplay_table *powerplay_table =
                 table_context->power_play_table;
         struct smu_baco_context *smu_baco = &smu->smu_baco;
+       PPTable_t *pptable = smu->smu_table.driver_pptable;
  #if 0
         PPTable_t *pptable = smu->smu_table.driver_pptable;
         const OverDriveLimits_t * const overdrive_upperlimits =
@@ -371,6 +372,9 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
         table_context->thermal_controller_type =
                 powerplay_table->thermal_controller_type;
 
+       smu->adev->pm.no_fan =
+               !(pptable->SkuTable.FeaturesToRun[0] & (1 << FEATURE_FAN_CONTROL_BIT));
+
         return 0;
  }
 
--

2.34.1

Reviewed-by
#3 lore raw
Quoted 9 lines · Lijo
Quoted 5 lines · Alex Deucher
Quoted 4 lines · Kenneth Feng

drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0
V2: depend on pm.no_fan to check

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

You can still read the fan speed though right? Don't we want to just not expose the ability to manually set the fan speed?

If PMFW is not controlling fan, there is no guarantee that the cooling solution (any other external one) is using GPU's fan controller itself. In that way, reading the speed from controller doesn't make sense.

Ah, ok, I misunderstood. My brain isn't working yet. This is for the case of the PMFW not controlling the fan.

Quoted 35 lines

Thanks,
Lijo

Quoted 32 lines

Alex

Quoted 29 lines
---
  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +4 -1
index fddcd834bcec..0fb6be11a0cc 100644
@@ -331,6 +331,7 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
         struct smu_13_0_0_powerplay_table *powerplay_table =
                 table_context->power_play_table;
         struct smu_baco_context *smu_baco = &smu->smu_baco;
+       PPTable_t *pptable = smu->smu_table.driver_pptable;
  #if 0
         PPTable_t *pptable = smu->smu_table.driver_pptable;
         const OverDriveLimits_t * const overdrive_upperlimits =
@@ -371,6 +372,9 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
         table_context->thermal_controller_type =
                 powerplay_table->thermal_controller_type;
 
+       smu->adev->pm.no_fan =
+               !(pptable->SkuTable.FeaturesToRun[0] & (1 << FEATURE_FAN_CONTROL_BIT));
+
         return 0;
  }
 
--

2.34.1

Reviewed-by
#4 lore raw
Quoted 15 lines · Alex Deucher
Quoted 14 lines · Lijo
Quoted 9 lines · Alex Deucher
Quoted 5 lines · Kenneth Feng

drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0
V2: depend on pm.no_fan to check

You can still read the fan speed though right? Don't we want to just not expose the ability to manually set the fan speed?

Quoted 7 lines
Quoted 4 lines

If PMFW is not controlling fan, there is no guarantee that the cooling solution (any other external one) is using GPU's fan controller itself. In that way, reading the speed from controller doesn't make sense.

Ah, ok, I misunderstood. My brain isn't working yet. This is for the case of the PMFW not controlling the fan.

Yes, not the overdrive related control :)

Thanks,
Lijo

Quoted 38 lines
Quoted 35 lines

Thanks,
Lijo

Quoted 32 lines

Alex

Quoted 29 lines
---
   drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 4 ++++
   1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +4 -1
index fddcd834bcec..0fb6be11a0cc 100644
@@ -331,6 +331,7 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
          struct smu_13_0_0_powerplay_table *powerplay_table =
                  table_context->power_play_table;
          struct smu_baco_context *smu_baco = &smu->smu_baco;
+       PPTable_t *pptable = smu->smu_table.driver_pptable;
   #if 0
          PPTable_t *pptable = smu->smu_table.driver_pptable;
          const OverDriveLimits_t * const overdrive_upperlimits =
@@ -371,6 +372,9 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
          table_context->thermal_controller_type =
                  powerplay_table->thermal_controller_type;
 
+       smu->adev->pm.no_fan =
+               !(pptable->SkuTable.FeaturesToRun[0] & (1 << FEATURE_FAN_CONTROL_BIT));
+
          return 0;
   }
 
--

2.34.1