This can address some reset failures observed on SMU13.0.0.

Signed-off-by: Evan Quan <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Change-Id: Ieb4e204c49abd405b1dce559c2ff75bb3887b6f9
--
v1->v2:
 - revise the code comments(Alex)
 - limit this to SMU13.0.0 and 13.0.7
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c 
b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 13c5c7f1ecb9..b0310b2e24f8 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1443,13 +1443,20 @@ static int smu_disable_dpms(struct smu_context *smu)
                 ((adev->in_runpm || adev->in_s4) && 
amdgpu_asic_supports_baco(adev)));
 
        /*
-        * For SMU 13.0.0 and 13.0.7, PMFW will handle the DPM 
features(disablement or others)
-        * properly on suspend/reset/unload. Driver involvement may cause some 
unexpected issues.
+        * For SMU 13.0.0 and 13.0.7, per PMFW team's suggestion,
+        * driver needs to disable gfxoff and df cstate features(this
+        * can address some mode1 reset failures). For other features,
+        * PMFW will handle them properly.
         */
        switch (adev->ip_versions[MP1_HWIP][0]) {
        case IP_VERSION(13, 0, 0):
        case IP_VERSION(13, 0, 7):
-               return 0;
+               if (smu->ppt_funcs->set_df_cstate) {
+                       ret = smu->ppt_funcs->set_df_cstate(smu, 
DF_CSTATE_DISALLOW);
+                       if (ret)
+                               dev_err(smu->adev->dev, "[SetDfCstate] 
failed!\n");
+               }
+               return ret;
        default:
                break;
        }
-- 
2.34.1

Reply via email to