drm/amd/pm: keep the BACO feature enabled for suspend
authorEvan Quan <evan.quan@amd.com>
Thu, 30 Dec 2021 09:53:54 +0000 (17:53 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Jan 2022 22:19:46 +0000 (17:19 -0500)
To pair with the workaround which always reset the ASIC in suspend.
Otherwise, the reset which relies on BACO will fail.

Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index 76f95e8ada4c43f02bacce50f6e6b200b5b5549b..d93d28c1af95ba85e73281f0a92bb25b326cc60b 100644 (file)
@@ -1405,8 +1405,14 @@ static int smu_disable_dpms(struct smu_context *smu)
 {
        struct amdgpu_device *adev = smu->adev;
        int ret = 0;
+       /*
+        * TODO: (adev->in_suspend && !adev->in_s0ix) is added to pair
+        * the workaround which always reset the asic in suspend.
+        * It's likely that workaround will be dropped in the future.
+        * Then the change here should be dropped together.
+        */
        bool use_baco = !smu->is_apu &&
-               ((amdgpu_in_reset(adev) &&
+               (((amdgpu_in_reset(adev) || (adev->in_suspend && !adev->in_s0ix)) &&
                  (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) ||
                 ((adev->in_runpm || adev->in_s4) && amdgpu_asic_supports_baco(adev)));