drm/amd/powerplay: move setting allowed mask and feature enabling together
authorHuang Rui <ray.huang@amd.com>
Wed, 20 Feb 2019 11:58:11 +0000 (19:58 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:04:02 +0000 (15:04 -0500)
This patch moves setting allowed mask and feature enabling together to refine
the programming sequence.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 7857ceb7403f94d0772cac3dbc406de3e0f7d882..fa6248d8adf9f5022dea869d6863509ea5fca417 100644 (file)
@@ -586,10 +586,6 @@ static int smu_smc_table_hw_init(struct smu_context *smu,
        if (ret)
                return ret;
 
-       ret = smu_feature_set_allowed_mask(smu);
-       if (ret)
-               return ret;
-
        if (initialize) {
                ret = smu_read_pptable_from_vbios(smu);
                if (ret)
@@ -654,6 +650,10 @@ static int smu_smc_table_hw_init(struct smu_context *smu,
        if (ret)
                return ret;
 
+       ret = smu_feature_set_allowed_mask(smu);
+       if (ret)
+               return ret;
+
        ret = smu_system_features_control(smu, true);
        if (ret)
                return ret;