drm/amdgpu/sriov Don't send msg when smu suspend
authorJack Zhang <Jack.Zhang1@amd.com>
Wed, 5 Feb 2020 08:34:27 +0000 (16:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Feb 2020 16:44:24 +0000 (11:44 -0500)
For sriov and pp_onevf_mode, do not send message to set smu
status, because smu doesn't support these messages under VF.

Besides, it should skip smu_suspend when pp_onevf_mode is disabled.

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 39cd545976b7ea57314717a021951674eb9de48d..a86e80842df9ba72bfbbbed0fc7762af45e4939b 100644 (file)
@@ -2344,15 +2344,16 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
                }
                adev->ip_blocks[i].status.hw = false;
                /* handle putting the SMC in the appropriate state */
-               if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
-                       r = amdgpu_dpm_set_mp1_state(adev, adev->mp1_state);
-                       if (r) {
-                               DRM_ERROR("SMC failed to set mp1 state %d, %d\n",
-                                         adev->mp1_state, r);
-                               return r;
+               if(!amdgpu_sriov_vf(adev)){
+                       if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
+                               r = amdgpu_dpm_set_mp1_state(adev, adev->mp1_state);
+                               if (r) {
+                                       DRM_ERROR("SMC failed to set mp1 state %d, %d\n",
+                                                       adev->mp1_state, r);
+                                       return r;
+                               }
                        }
                }
-
                adev->ip_blocks[i].status.hw = false;
        }
 
index 99ad4ddbe12f01c89e36460eac27cc194f66bd72..a6d7b5f3aa82396261ba146cf4a30a40f8b480df 100644 (file)
@@ -1461,21 +1461,26 @@ static int smu_suspend(void *handle)
        struct smu_context *smu = &adev->smu;
        bool baco_feature_is_enabled = false;
 
+       if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
+               return 0;
+
        if (!smu->pm_enabled)
                return 0;
 
        if(!smu->is_apu)
                baco_feature_is_enabled = smu_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT);
 
-       ret = smu_system_features_control(smu, false);
-       if (ret)
-               return ret;
-
-       if (baco_feature_is_enabled) {
-               ret = smu_feature_set_enabled(smu, SMU_FEATURE_BACO_BIT, true);
-               if (ret) {
-                       pr_warn("set BACO feature enabled failed, return %d\n", ret);
+       if(!amdgpu_sriov_vf(adev)) {
+               ret = smu_system_features_control(smu, false);
+               if (ret)
                        return ret;
+
+               if (baco_feature_is_enabled) {
+                       ret = smu_feature_set_enabled(smu, SMU_FEATURE_BACO_BIT, true);
+                       if (ret) {
+                               pr_warn("set BACO feature enabled failed, return %d\n", ret);
+                               return ret;
+                       }
                }
        }