Skip to contentSkip to conversation

drm/amd/pm: keep the BACO feature enabled for suspend

PATCH In review Evan Quan 3 participants 3 messages Dec 30, 2021 – Dec 31, 2021

Subsystems (3)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/pm: keep the BACO feature enabled for suspend

To pair with the workaround which always reset the ASIC in suspend. Otherwise, the reset which relies on BACO will fail.

Fixes 50583690930d ("drm/amdgpu: always reset the asic in suspend (v2)")
Change-Id I39ed072af16e34ef1e1c16b50ace6d46fbc388b9
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +7 -1
index 4d867778a65c..7628be2f2301 100644
@@ -1308,10 +1308,16 @@ 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_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) ||
-		 ((adev->in_runpm || adev->in_s4) && amdgpu_asic_supports_baco(adev)));
+		 ((adev->in_runpm || adev->in_s4 || (adev->in_suspend && !adev->in_s0ix)) && amdgpu_asic_supports_baco(adev)));
 
 	/*
 	 * For custom pptable uploading, skip the DPM features
Signature · 1 line
2.29.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 37 lines · Evan Quan

To pair with the workaround which always reset the ASIC in suspend. Otherwise, the reset which relies on BACO will fail.

Fixes 50583690930d ("drm/amdgpu: always reset the asic in suspend (v2)")
Change-Id I39ed072af16e34ef1e1c16b50ace6d46fbc388b9
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +7 -2
index 4d867778a65c..7628be2f2301 100644
@@ -1308,10 +1308,16 @@ 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_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) ||
-                ((adev->in_runpm || adev->in_s4) && amdgpu_asic_supports_baco(adev)));
+                ((adev->in_runpm || adev->in_s4 || (adev->in_suspend && !adev->in_s0ix)) && amdgpu_asic_supports_baco(adev)));
 
        /*
         * For custom pptable uploading, skip the DPM features
--

2.29.0

Reviewed-by on v1 1/1
#2 lore raw
In reply to Evan Quan

[Public]

Regards,
Guchun

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Thursday, December 30, 2021 6:01 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: keep the BACO feature enabled for suspend

To pair with the workaround which always reset the ASIC in suspend. Otherwise, the reset which relies on BACO will fail.

Fixes 50583690930d ("drm/amdgpu: always reset the asic in suspend (v2)")
Change-Id I39ed072af16e34ef1e1c16b50ace6d46fbc388b9
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +8 -2
index 4d867778a65c..7628be2f2301 100644
@@ -1308,10 +1308,16 @@ 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_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) ||
-		 ((adev->in_runpm || adev->in_s4) && amdgpu_asic_supports_baco(adev)));
+		 ((adev->in_runpm || adev->in_s4 || (adev->in_suspend && 
+!adev->in_s0ix)) && amdgpu_asic_supports_baco(adev)));
 
 	/*
 	 * For custom pptable uploading, skip the DPM features
--

2.29.0