[PATCH] drm/amdgpu/sriov Don't send msg when smu suspend
Alex Deucher
alexdeucher at gmail.com
Thu Feb 6 02:52:59 UTC 2020
On Wed, Feb 5, 2020 at 4:18 AM Jack Zhang <Jack.Zhang1 at amd.com> wrote:
>
> For sriov and pp_onevf_mode, do not send message to set smu
> status, becasue smu doesn't support these messages under VF.
Typo: becasue -> because
With that fixed:
Acked-by: Alex Deucher <alexander.deucher at amd.com>
>
> Besides, it should skip smu_suspend when pp_onevf_mode is disabled.
>
> Signed-off-by: Jack Zhang <Jack.Zhang1 at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++++++-------
> drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 21 +++++++++++++--------
> 2 files changed, 21 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 4ff7ce3..2d1f8d4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2353,15 +2353,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;
> }
>
> diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> index 99ad4dd..a6d7b5f 100644
> --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> @@ -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;
> + }
> }
> }
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list