From: Ryan Taylor Date: Wed, 28 Jul 2021 19:14:05 +0000 (-0700) Subject: drm/amd/pm: restore fan_mode AMD_FAN_CTRL_NONE on resume (v2) X-Git-Tag: v5.15~303^2~10^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d58f1a52b2e4401ad4970f439ff32ed63989ddb;p=platform%2Fkernel%2Flinux-starfive.git drm/amd/pm: restore fan_mode AMD_FAN_CTRL_NONE on resume (v2) Adds missing edge case to smu_restore_dpm_user_profile. v2: Don't restore fan mode auto (Lijo) Reviewed-by: Lijo Lazar Reviewed-by: Alex Deucher Signed-off-by: Ryan Taylor Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 71afc2d..b4b4d61 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -403,7 +403,8 @@ static void smu_restore_dpm_user_profile(struct smu_context *smu) } /* set the user dpm fan configurations */ - if (smu->user_dpm_profile.fan_mode == AMD_FAN_CTRL_MANUAL) { + if (smu->user_dpm_profile.fan_mode == AMD_FAN_CTRL_MANUAL || + smu->user_dpm_profile.fan_mode == AMD_FAN_CTRL_NONE) { ret = smu_set_fan_control_mode(smu, smu->user_dpm_profile.fan_mode); if (ret) { dev_err(smu->adev->dev, "Failed to set manual fan control mode\n"); @@ -620,6 +621,7 @@ static int smu_early_init(void *handle) mutex_init(&smu->smu_baco.mutex); smu->smu_baco.state = SMU_BACO_STATE_EXIT; smu->smu_baco.platform_support = false; + smu->user_dpm_profile.fan_mode = -1; adev->powerplay.pp_handle = smu; adev->powerplay.pp_funcs = &swsmu_pm_funcs;