drm/amd/pm: graceful exit on restore fan mode failure (v2)
authorRyan Taylor <Ryan.Taylor@amd.com>
Fri, 6 Aug 2021 21:19:40 +0000 (14:19 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 11 Aug 2021 21:18:26 +0000 (17:18 -0400)
Attempt od settings restore and disable restore flag on restore fan mode
failure.

v2: Update fan mode to auto and fan speed to zero (Lijo)

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Ryan Taylor <Ryan.Taylor@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index b4b4d615bcbcbb5772c9e764ad78428014a8a6c4..00d594e6dd85186e26ab15657b0214cdce79cbaf 100644 (file)
@@ -407,11 +407,12 @@ static void smu_restore_dpm_user_profile(struct smu_context *smu)
            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) {
+                       smu->user_dpm_profile.fan_speed_percent = 0;
+                       smu->user_dpm_profile.fan_mode = AMD_FAN_CTRL_AUTO;
                        dev_err(smu->adev->dev, "Failed to set manual fan control mode\n");
-                       return;
                }
 
-               if (!ret && smu->user_dpm_profile.fan_speed_percent) {
+               if (smu->user_dpm_profile.fan_speed_percent) {
                        ret = smu_set_fan_speed_percent(smu, smu->user_dpm_profile.fan_speed_percent);
                        if (ret)
                                dev_err(smu->adev->dev, "Failed to set manual fan speed\n");