Skip to contentSkip to conversation

amdgpu/soc15: enable asic reset for dGPU in case of suspend abort

PATCH In review Jiang Liu 3 participants 5 messages Jan 13, 2025 – Jan 22, 2025 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Jiang Liu

author
#1 lore raw

PATCH 1/1 amdgpu/soc15: enable asic reset for dGPU in case of suspend abort

In reply to a message not in the archive

When GPU suspend is aborted, do the same for dGPU as APU to reset soc15 asic. Otherwise it may cause following errors:

[  547.229463] amdgpu 0001:81:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126827] amdgpu 0000:0a:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126901] [drm:amdgpu_gfx_enable_kcq [amdgpu]] *ERROR* KCQ enable failed
[  555.126957] [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <gfx_v9_4_3> failed -110
[  555.126959] amdgpu 0000:0a:00.0: amdgpu: amdgpu_device_ip_resume failed (-110).
[  555.126965] PM: dpm_run_callback(): pci_pm_resume+0x0/0xe0 returns -110
[  555.126966] PM: Device 0000:0a:00.0 failed to resume async: error -110

This fix has been tested on Mi308X.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +3 -5
index a59b4c36cad7..0e1daefd1a8e 100644
@@ -605,12 +605,10 @@ soc15_asic_reset_method(struct amdgpu_device *adev)
 static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
 {
 	/* Will reset for the following suspend abort cases.
-	 * 1) Only reset on APU side, dGPU hasn't checked yet.
-	 * 2) S3 suspend aborted in the normal S3 suspend or
-	 *    performing pm core test.
+	 * 1) S3 suspend aborted in the normal S3 suspend
+	 * 2) S3 suspend aborted in performing pm core test.
 	 */
-	if (adev->flags & AMD_IS_APU && adev->in_s3 &&
-			!pm_resume_via_firmware())
+	if (adev->in_s3 && !pm_resume_via_firmware())
 		return true;
 	else
 		return false;
Signature · 1 line
2.43.5
Reviewed-by on v1 1/1
#2 lore raw
Quoted 11 lines · Jiang Liu

When GPU suspend is aborted, do the same for dGPU as APU to reset soc15 asic. Otherwise it may cause following errors:

[  547.229463] amdgpu 0001:81:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126827] amdgpu 0000:0a:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126901] [drm:amdgpu_gfx_enable_kcq [amdgpu]] *ERROR* KCQ enable failed
[  555.126957] [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <gfx_v9_4_3> failed -110
[  555.126959] amdgpu 0000:0a:00.0: amdgpu: amdgpu_device_ip_resume failed (-110).
[  555.126965] PM: dpm_run_callback(): pci_pm_resume+0x0/0xe0 returns -110
[  555.126966] PM: Device 0000:0a:00.0 failed to resume async: error -110
Quoted 4 lines

This fix has been tested on Mi308X.

I'll get this committed to amd-staging-drm-next, thanks.

Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/soc15.c | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +3 -5
index a59b4c36cad7..0e1daefd1a8e 100644
@@ -605,12 +605,10 @@ soc15_asic_reset_method(struct amdgpu_device *adev)
  static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
  {
  	/* Will reset for the following suspend abort cases.
-	 * 1) Only reset on APU side, dGPU hasn't checked yet.
-	 * 2) S3 suspend aborted in the normal S3 suspend or
-	 *    performing pm core test.
+	 * 1) S3 suspend aborted in the normal S3 suspend
+	 * 2) S3 suspend aborted in performing pm core test.
  	 */
-	if (adev->flags & AMD_IS_APU && adev->in_s3 &&
-			!pm_resume_via_firmware())
+	if (adev->in_s3 && !pm_resume_via_firmware())
  		return true;
  	else
  		return false;
#3 lore raw
In reply to Jiang Liu
Quoted 27 lines · Jiang Liu

When GPU suspend is aborted, do the same for dGPU as APU to reset soc15 asic. Otherwise it may cause following errors:

[  547.229463] amdgpu 0001:81:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126827] amdgpu 0000:0a:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126901] [drm:amdgpu_gfx_enable_kcq [amdgpu]] *ERROR* KCQ enable failed
[  555.126957] [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <gfx_v9_4_3> failed -110
[  555.126959] amdgpu 0000:0a:00.0: amdgpu: amdgpu_device_ip_resume failed (-110).
[  555.126965] PM: dpm_run_callback(): pci_pm_resume+0x0/0xe0 returns -110
[  555.126966] PM: Device 0000:0a:00.0 failed to resume async: error -110

This fix has been tested on Mi308X.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -0
index a59b4c36cad7..0e1daefd1a8e 100644
@@ -605,12 +605,10 @@ soc15_asic_reset_method(struct amdgpu_device *adev)
 static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
 {
 	/* Will reset for the following suspend abort cases.

drivers/gpu/drm/amd/amdgpu/soc15.c soc15_asic_reset_method(struct amdgpu_device *adev) · line 612

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +3 -5
-	 * 1) Only reset on APU side, dGPU hasn't checked yet.
-	 * 2) S3 suspend aborted in the normal S3 suspend or
-	 *    performing pm core test.
+	 * 1) S3 suspend aborted in the normal S3 suspend
+	 * 2) S3 suspend aborted in performing pm core test.
 	 */
-	if (adev->flags & AMD_IS_APU && adev->in_s3 &&
-			!pm_resume_via_firmware())
+	if (adev->in_s3 && !pm_resume_via_firmware())
 		return true;

I don't think this can be applied to all environments. For ex: this may not be applicable for dGPUs combined with ARM CPUs.

Thanks,
Lijo

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -0
 	else
 		return false;
#4 lore raw
Quoted 35 lines · Lijo
Quoted 32 lines · Jiang Liu

When GPU suspend is aborted, do the same for dGPU as APU to reset soc15 asic. Otherwise it may cause following errors:

[  547.229463] amdgpu 0001:81:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126827] amdgpu 0000:0a:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126901] [drm:amdgpu_gfx_enable_kcq [amdgpu]] *ERROR* KCQ enable failed
[  555.126957] [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <gfx_v9_4_3> failed -110
[  555.126959] amdgpu 0000:0a:00.0: amdgpu: amdgpu_device_ip_resume failed (-110).
[  555.126965] PM: dpm_run_callback(): pci_pm_resume+0x0/0xe0 returns -110
[  555.126966] PM: Device 0000:0a:00.0 failed to resume async: error -110

This fix has been tested on Mi308X.

---
  drivers/gpu/drm/amd/amdgpu/soc15.c | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +2 -3
index a59b4c36cad7..0e1daefd1a8e 100644
@@ -605,12 +605,10 @@ soc15_asic_reset_method(struct amdgpu_device *adev)
  static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
  {
  	/* Will reset for the following suspend abort cases.
-	 * 1) Only reset on APU side, dGPU hasn't checked yet.
-	 * 2) S3 suspend aborted in the normal S3 suspend or
-	 *    performing pm core test.
+	 * 1) S3 suspend aborted in the normal S3 suspend
+	 * 2) S3 suspend aborted in performing pm core test.
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/soc15.c soc15_asic_reset_method(struct amdgpu_device *adev) · line 612

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
  	 */
-	if (adev->flags & AMD_IS_APU && adev->in_s3 &&
-			!pm_resume_via_firmware())
+	if (adev->in_s3 && !pm_resume_via_firmware())
  		return true;

I don't think this can be applied to all environments. For ex: this may not be applicable for dGPUs combined with ARM CPUs.

I looked through amdgpu_acpi cases and I'm not sure I agree with this.
On ARM side amdgpu_acpi_is_s3_active() should never return true because ARM doesn't support PM_SUSPEND_MEM.

This means that amdgpu_choose_low_power_state() shouldn't set is_s3 either.

So I don't think this block will run on ARM side.

That being said, we might have other more fundamental issues to worry about with suspend/resume than handling aborted suspend/resume when run on non-x86 so the whole set of amdgpu suspend/resume code might need to be revisited.

#5 lore raw
Quoted 54 lines · Mario Limonciello
Quoted 44 lines · Lijo
Quoted 41 lines · Jiang Liu

When GPU suspend is aborted, do the same for dGPU as APU to reset soc15 asic. Otherwise it may cause following errors:
[  547.229463] amdgpu 0001:81:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)

[  555.126827] amdgpu 0000:0a:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_0.2.1.0 test failed (-110)
[  555.126901] [drm:amdgpu_gfx_enable_kcq [amdgpu]] *ERROR* KCQ enable failed
[  555.126957] [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <gfx_v9_4_3> failed -110
[  555.126959] amdgpu 0000:0a:00.0: amdgpu: amdgpu_device_ip_resume failed (-110).
[  555.126965] PM: dpm_run_callback(): pci_pm_resume+0x0/0xe0 returns -110
[  555.126966] PM: Device 0000:0a:00.0 failed to resume async: error -110

This fix has been tested on Mi308X.

---
  drivers/gpu/drm/amd/amdgpu/soc15.c | 8 +++-----

  1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/ renamed from drivers/gpu/drm/amd/amdgpu/soc15.c +0 -0

amd/amdgpu/soc15.c
index a59b4c36cad7..0e1daefd1a8e 100644

drivers/gpu/drm/amd/amdgpu/soc15.c +2 -3
@@ -605,12 +605,10 @@ soc15_asic_reset_method(struct amdgpu_device
 *adev)
   static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
   {
       /* Will reset for the following suspend abort cases.
-     * 1) Only reset on APU side, dGPU hasn't checked yet.
-     * 2) S3 suspend aborted in the normal S3 suspend or
-     *    performing pm core test.
+     * 1) S3 suspend aborted in the normal S3 suspend
+     * 2) S3 suspend aborted in performing pm core test.
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/soc15.c soc15_asic_reset_method(struct amdgpu_device *adev) · line 612

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
        */
-    if (adev->flags & AMD_IS_APU && adev->in_s3 &&
-            !pm_resume_via_firmware())
+    if (adev->in_s3 && !pm_resume_via_firmware())
           return true;

I don't think this can be applied to all environments. For ex: this may not be applicable for dGPUs combined with ARM CPUs.

Quoted 7 lines

I looked through amdgpu_acpi cases and I'm not sure I agree with this. On ARM side amdgpu_acpi_is_s3_active() should never return true because ARM doesn't support PM_SUSPEND_MEM.

This means that amdgpu_choose_low_power_state() shouldn't set is_s3 either.

So I don't think this block will run on ARM side.

ARM is not the fundamental issue. It's for any platform which supports suspend/resume outside of ACPI. The original patch is accepted only for APUs for that reason.

Thanks,
Lijo

Quoted 5 lines

That being said, we might have other more fundamental issues to worry about with suspend/resume than handling aborted suspend/resume when run on non-x86 so the whole set of amdgpu suspend/resume code might need to be revisited.