]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: fix S3 failed as RLC safe mode entry stucked in polloing gfx acq
authorPrike Liang <Prike.Liang@amd.com>
Tue, 15 Oct 2019 09:11:49 +0000 (17:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 17 Oct 2019 20:24:09 +0000 (16:24 -0400)
Fix gfx cgpg setting sequence for RLC deadlock at safe mode entry in polling gfx response.
The patch can fix VCN IB test failed and DAL get dispaly count failed issue.

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

index f545ecbe2ce25601f4733a1bc0283d744260878b..47e256b6a0e59673c190bb1d034360b1b79a5780 100644 (file)
@@ -4287,9 +4287,6 @@ static void gfx_v9_0_update_gfx_cg_power_gating(struct amdgpu_device *adev,
 {
        amdgpu_gfx_rlc_enter_safe_mode(adev);
 
-       if (is_support_sw_smu(adev) && !enable)
-               smu_set_gfx_cgpg(&adev->smu, enable);
-
        if ((adev->pg_flags & AMD_PG_SUPPORT_GFX_PG) && enable) {
                gfx_v9_0_enable_gfx_cg_power_gating(adev, true);
                if (adev->pg_flags & AMD_PG_SUPPORT_GFX_PIPELINE)
@@ -4566,8 +4563,6 @@ static int gfx_v9_0_set_powergating_state(void *handle,
                        gfx_v9_0_enable_cp_power_gating(adev, false);
 
                /* update gfx cgpg state */
-               if (is_support_sw_smu(adev) && enable)
-                       smu_set_gfx_cgpg(&adev->smu, enable);
                gfx_v9_0_update_gfx_cg_power_gating(adev, enable);
 
                /* update mgcg state */
index acec69b7473494ed792aa1d6acdc03fe894ff790..e2a03f411d6bacb087d3f14b66c420315484f69f 100644 (file)
@@ -1188,6 +1188,7 @@ static int smu_hw_init(void *handle)
        if (adev->flags & AMD_IS_APU) {
                smu_powergate_sdma(&adev->smu, false);
                smu_powergate_vcn(&adev->smu, false);
+               smu_set_gfx_cgpg(&adev->smu, true);
        }
 
        if (!smu->pm_enabled)
@@ -1350,6 +1351,9 @@ static int smu_resume(void *handle)
        if (ret)
                goto failed;
 
+       if (smu->is_apu)
+               smu_set_gfx_cgpg(&adev->smu, true);
+
        mutex_unlock(&smu->mutex);
 
        pr_info("SMU is resumed successfully!\n");