Skip to contentSkip to conversation

drm/amdgpu: don't use BACO for reset in S3

PATCH Superseded Alex Deucher 4 participants 4 messages Mar 31, 2022 – Apr 1, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: don't use BACO for reset in S3

Seems to cause a reboots or hangs on some systems.

Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
---
 drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +3 -0
index c73fb73e9628..1ff6c42fb110 100644
@@ -173,6 +173,9 @@ bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)
 
 	if (!pp_funcs || !pp_funcs->get_asic_baco_capability)
 		return false;
+	/* don't use baco for reset in S3 */
+	if (adev->in_s3)
+		return false;
 
 	mutex_lock(&adev->pm.mutex);
 
Signature · 1 line
2.35.1
#1 lore raw

Dear Alex,

Thank you for your patch.

Am 31.03.22 um 16:56 schrieb Alex Deucher:

Quoted 1 line

Seems to cause a reboots or hangs on some systems.

It’d be great if you listed the systems from the bug reports.

Quoted 13 lines
Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
---
  drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0 -0
index c73fb73e9628..1ff6c42fb110 100644

drivers/gpu/drm/amd/pm/amdgpu_dpm.c bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev) · line 176

Quoted 4 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +1 -0
@@ -173,6 +173,9 @@ bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)
 
  	if (!pp_funcs || !pp_funcs->get_asic_baco_capability)
  		return false;
+	/* don't use baco for reset in S3 */

In issue #1924, I think you also write, it’s a workaround. Maybe make that clear in the comment?

drivers/gpu/drm/amd/pm/amdgpu_dpm.c bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev) · line 181

Quoted 5 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +2 -0
+	if (adev->in_s3)
+		return false;
 
  	mutex_lock(&adev->pm.mutex);
 

Kind regards,

Paul

#2 lore raw
In reply to Alex Deucher
Quoted 15 lines · Alex Deucher

Seems to cause a reboots or hangs on some systems.

Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
---
  drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0 -0
index c73fb73e9628..1ff6c42fb110 100644

drivers/gpu/drm/amd/pm/amdgpu_dpm.c bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev) · line 179

Quoted 7 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +3 -0
@@ -173,6 +173,9 @@ bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)
 
  	if (!pp_funcs || !pp_funcs->get_asic_baco_capability)
  		return false;
+	/* don't use baco for reset in S3 */
+	if (adev->in_s3)
+		return false;
 

Suggest to add && !adev->runpm to the workaround. For runpm supported devices, most likely it should work.

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0 -0
  	mutex_lock(&adev->pm.mutex);
 
#3 lore raw
Quoted 20 lines · Lijo
Quoted 16 lines · Alex Deucher

Seems to cause a reboots or hangs on some systems.

Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
---
  drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0 -0
index c73fb73e9628..1ff6c42fb110 100644
@@ -173,6 +173,9 @@ bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)
 
Quoted 9 lines

drivers/gpu/drm/amd/pm/amdgpu_dpm.c bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev) · line 179

Quoted 6 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +3 -0
      if (!pp_funcs || !pp_funcs->get_asic_baco_capability)
              return false;
+     /* don't use baco for reset in S3 */
+     if (adev->in_s3)
+             return false;
 

Suggest to add && !adev->runpm to the workaround. For runpm supported devices, most likely it should work.

hmm. I've kind of gone back and forth with this. BACO works fine for runtime suspend on all of the GPUs that reported problems in the bugs. I think it's probably something timing related with the state of the system during suspend. Actually, thinking about it more, I think it may be related to the fact that BACO also controls the power to other devices on the GPU (e.g., audio or USB). For runtime suspend, that is handled via device dependencies, but at system suspend time, perhaps the BACO sequence causes havoc with the other devices.

Alex

Quoted 7 lines

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0 -0
      mutex_lock(&adev->pm.mutex);