提交 57301181 编写于 作者: E Elena Sakhnovitch 提交者: Alex Deucher

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

On Sienna Cichild, not all platforms use PMFW based fan control
(ex: fanless systems). 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.

v3: FeaturesToRun casted as uint64_t
Signed-off-by: NElena Sakhnovitch  <elena.sakhnovitch@amd.com>
Reviewed-by: NLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 996ea859
...@@ -371,6 +371,20 @@ static void sienna_cichlid_check_bxco_support(struct smu_context *smu) ...@@ -371,6 +371,20 @@ static void sienna_cichlid_check_bxco_support(struct smu_context *smu)
} }
} }
static void sienna_cichlid_check_fan_support(struct smu_context *smu)
{
struct smu_table_context *table_context = &smu->smu_table;
PPTable_t *pptable = table_context->driver_pptable;
uint64_t features = *(uint64_t *) pptable->FeaturesToRun;
/* Fan control is not possible if PPTable has it disabled */
smu->adev->pm.no_fan =
!(features & (1ULL << FEATURE_FAN_CONTROL_BIT));
if (smu->adev->pm.no_fan)
dev_info_once(smu->adev->dev,
"PMFW based fan control disabled");
}
static int sienna_cichlid_check_powerplay_table(struct smu_context *smu) static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
{ {
struct smu_table_context *table_context = &smu->smu_table; struct smu_table_context *table_context = &smu->smu_table;
...@@ -381,6 +395,7 @@ static int sienna_cichlid_check_powerplay_table(struct smu_context *smu) ...@@ -381,6 +395,7 @@ static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
smu->dc_controlled_by_gpio = true; smu->dc_controlled_by_gpio = true;
sienna_cichlid_check_bxco_support(smu); sienna_cichlid_check_bxco_support(smu);
sienna_cichlid_check_fan_support(smu);
table_context->thermal_controller_type = table_context->thermal_controller_type =
powerplay_table->thermal_controller_type; powerplay_table->thermal_controller_type;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册