Skip to contentSkip to conversation

drm/amdgpu: skipping SDMA IP suspend for S0ix.

PATCH In review Rajib Mahapatra 3 participants 5 messages Feb 2, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: skipping SDMA IP suspend for S0ix.

[Why]
amdgpu error observed if suspend is aborted during S0i3 resume.

[How]
If suspend is aborted for some reason during S0i3 resume cycle, it follows amdgpu errors in resume. Skipping SDMA ip in suspend solves the issue on RENOIR (green sardine apu) chip. This time, the system is able to resume gracefully even the suspend is aborted.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +10 -0
index 7931132ce6e3..f01b1dffff7f 100644
@@ -2927,6 +2927,16 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
 		     adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX))
 			continue;
 
+		/* skip suspend of sdma for S0ix
+		 * Resume has issues if the suspend is aborted during S0i3 cycle.
+		 * Skipping sdma for RN/CZN/BRC chip - green sardine apu.
+		 */
+		if (adev->in_s0ix &&
+		    (adev->asic_type == CHIP_RENOIR &&
+		     (adev->pdev->device == 0x15e7 || adev->pdev->device == 0x1638) &&
+		     adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
+			continue;
+
 		/* XXX handle errors */
 		r = adev->ip_blocks[i].version->funcs->suspend(adev);
 		/* XXX handle errors */
Signature · 1 line
2.25.1
#1 lore raw

[Public]

Quoted 53 lines

-----Original Message-----
From: Mahapatra, Rajib <[email protected]>
Sent: Wednesday, February 2, 2022 03:07
To: Liang, Prike <[email protected]>; Limonciello, Mario <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>; Mahapatra, Rajib <[email protected]>
Subject: [PATCH] drm/amdgpu: skipping SDMA IP suspend for S0ix.

[Why]
amdgpu error observed if suspend is aborted during S0i3 resume.

[How]
If suspend is aborted for some reason during S0i3 resume cycle, it follows amdgpu errors in resume. Skipping SDMA ip in suspend solves the issue on RENOIR (green sardine apu) chip. This time, the system is able to resume gracefully even the suspend is aborted.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
index 7931132ce6e3..f01b1dffff7f 100644
@@ -2927,6 +2927,16 @@ static int amdgpu_device_ip_suspend_phase2(struct
 amdgpu_device *adev)
 		     adev->ip_blocks[i].version->type ==
 AMD_IP_BLOCK_TYPE_GFX))
 			continue;
 
+		/* skip suspend of sdma for S0ix
+		 * Resume has issues if the suspend is aborted during S0i3 cycle.
+		 * Skipping sdma for RN/CZN/BRC chip - green sardine apu.
+		 */
+		if (adev->in_s0ix &&
+		    (adev->asic_type == CHIP_RENOIR &&
+		     (adev->pdev->device == 0x15e7 || adev->pdev->device ==

0x1638) &&

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -0
+		     adev->ip_blocks[i].version->type ==

AMD_IP_BLOCK_TYPE_SDMA))

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
+			continue;
+
 		/* XXX handle errors */
 		r = adev->ip_blocks[i].version->funcs->suspend(adev);
 		/* XXX handle errors */
--
Quoted 1 line

2.25.1

As this is specific to RN/CZN I think this check is better suited in drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c perhaps in sdma_v4_0_suspend/sdma_v4_0_resume functions.

The aborted suspend case if it's specific to s0ix, can also use adev->in_s0ix as part of the check.

#2 lore raw
In reply to Rajib Mahapatra
Quoted 22 lines · Rajib Mahapatra

[Why]
amdgpu error observed if suspend is aborted during S0i3 resume.

[How]
If suspend is aborted for some reason during S0i3 resume cycle, it follows amdgpu errors in resume. Skipping SDMA ip in suspend solves the issue on RENOIR (green sardine apu) chip. This time, the system is able to resume gracefully even the suspend is aborted.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 7931132ce6e3..f01b1dffff7f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) · line 2936

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
@@ -2927,6 +2927,16 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
                     adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX))
                        continue;
 
+               /* skip suspend of sdma for S0ix
+                * Resume has issues if the suspend is aborted during S0i3 cycle.
+                * Skipping sdma for RN/CZN/BRC chip - green sardine apu.
+                */
+               if (adev->in_s0ix &&
+                   (adev->asic_type == CHIP_RENOIR &&
+                    (adev->pdev->device == 0x15e7 || adev->pdev->device == 0x1638) &&

The check here seems to contradict the comment above. Is this all Renoir based APUs or just green sardine? If it's just green sardine, you can check the APU flags rather than the PCI ids. E.g., (adev->apu_flags & AMD_APU_IS_GREEN_SARDINE)
Also move this to sdma 4 code as Mario suggested.

Alex

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -1
+                    adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
+                       continue;
+
                /* XXX handle errors */
                r = adev->ip_blocks[i].version->funcs->suspend(adev);
                /* XXX handle errors */
--

2.25.1

#3 lore raw
Quoted 26 lines · Alex Deucher
Quoted 25 lines · Rajib Mahapatra

[Why]
amdgpu error observed if suspend is aborted during S0i3 resume.

[How]
If suspend is aborted for some reason during S0i3 resume cycle, it follows amdgpu errors in resume. Skipping SDMA ip in suspend solves the issue on RENOIR (green sardine apu) chip. This time, the system is able to resume gracefully even the suspend is aborted.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++++++
  1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 7931132ce6e3..f01b1dffff7f 100644
@@ -2927,6 +2927,16 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
                      adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX))
                         continue;
 
Quoted 13 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) · line 2936

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
+               /* skip suspend of sdma for S0ix
+                * Resume has issues if the suspend is aborted during S0i3 cycle.
+                * Skipping sdma for RN/CZN/BRC chip - green sardine apu.
+                */
+               if (adev->in_s0ix &&
+                   (adev->asic_type == CHIP_RENOIR &&
+                    (adev->pdev->device == 0x15e7 || adev->pdev->device == 0x1638) &&

The check here seems to contradict the comment above. Is this all Renoir based APUs or just green sardine? If it's just green sardine, you can check the APU flags rather than the PCI ids. E.g., (adev->apu_flags & AMD_APU_IS_GREEN_SARDINE)
Also move this to sdma 4 code as Mario suggested.

Both RN and green sardine share the same flows for SMU, I would think it should just be match (adev->in_s0xi && (adev->flags & AMD_IS_APU)) when it's moved to skip suspend.

Quoted 12 lines

Alex

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -1
+                    adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
+                       continue;
+
                 /* XXX handle errors */
                 r = adev->ip_blocks[i].version->funcs->suspend(adev);
                 /* XXX handle errors */
--

2.25.1

#4 lore raw
Quoted 42 lines · Mario
Quoted 26 lines · Alex Deucher
Quoted 25 lines · Rajib Mahapatra

[Why]
amdgpu error observed if suspend is aborted during S0i3 resume.

[How]
If suspend is aborted for some reason during S0i3 resume cycle, it follows amdgpu errors in resume. Skipping SDMA ip in suspend solves the issue on RENOIR (green sardine apu) chip. This time, the system is able to resume gracefully even the suspend is aborted.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++++++
  1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 7931132ce6e3..f01b1dffff7f 100644
@@ -2927,6 +2927,16 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
                      adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX))
                         continue;
 
Quoted 13 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) · line 2936

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
+               /* skip suspend of sdma for S0ix
+                * Resume has issues if the suspend is aborted during S0i3 cycle.
+                * Skipping sdma for RN/CZN/BRC chip - green sardine apu.
+                */
+               if (adev->in_s0ix &&
+                   (adev->asic_type == CHIP_RENOIR &&
+                    (adev->pdev->device == 0x15e7 || adev->pdev->device == 0x1638) &&

The check here seems to contradict the comment above. Is this all Renoir based APUs or just green sardine? If it's just green sardine, you can check the APU flags rather than the PCI ids. E.g., (adev->apu_flags & AMD_APU_IS_GREEN_SARDINE)
Also move this to sdma 4 code as Mario suggested.

Quoted 3 lines

Both RN and green sardine share the same flows for SMU, I would think it should just be match (adev->in_s0xi && (adev->flags & AMD_IS_APU)) when it's moved to skip suspend.

The SDMA 4.0 code is shared with Raven1/2 and Picasso as well. We should verify that it's required for them as well.

Alex

Quoted 14 lines
Quoted 13 lines

Alex

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -1
+                    adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
+                       continue;
+
                 /* XXX handle errors */
                 r = adev->ip_blocks[i].version->funcs->suspend(adev);
                 /* XXX handle errors */
--

2.25.1