Skip to contentSkip to conversation

drm/amdgpu: force exit gfxoff on sdma resume for rmb s0ix

PATCH In review Prike Liang 1 participant 2 messages Sep 24, 2021

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

PATCH 1/1 drm/amdgpu: force exit gfxoff on sdma resume for rmb s0ix

In the s2idle stress test sdma resume fail occasionally,in the failed case GPU is in the gfxoff state.This issue may introduce by FSDL miss handle doorbell S/R and now temporary fix the issue by forcing exit gfxoff for sdma resume.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +11 -0
index 24b0195..af759ab 100644
@@ -7608,6 +7608,14 @@ static int gfx_v10_0_suspend(void *handle)
 
 static int gfx_v10_0_resume(void *handle)
 {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	/* TODO: check whether can submit a doorbell request to raise
+	 * a doorbell fence to exit gfxoff.
+	 */
+	if (adev->in_s0ix)
+		amdgpu_gfx_off_ctrl(adev, false);
+
 	return gfx_v10_0_hw_init(handle);
 }
 
@@ -7819,6 +7827,9 @@ static int gfx_v10_0_late_init(void *handle)
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 	int r;
 
+	if (adev->in_s0ix)
+		 amdgpu_gfx_off_ctrl(adev, true);
+
 	r = amdgpu_irq_get(adev, &adev->gfx.priv_reg_irq, 0);
 	if (r)
 		return r;
Signature · 1 line
2.7.4
#1 lore raw

[Public]

Hold on there's still need further check the gfxoff control residence and will update the patch.

Thanks,
Prike

Quoted 49 lines

-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Friday, September 24, 2021 1:18 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Huang, Ray <[email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH] drm/amdgpu: force exit gfxoff on sdma resume for rmb s0ix

In the s2idle stress test sdma resume fail occasionally,in the failed case GPU is in the gfxoff state.This issue may introduce by FSDL miss handle doorbell S/R and now temporary fix the issue by forcing exit gfxoff for sdma resume.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +11 -1
index 24b0195..af759ab 100644
@@ -7608,6 +7608,14 @@ static int gfx_v10_0_suspend(void *handle)
 
 static int gfx_v10_0_resume(void *handle)  {
+     struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+     /* TODO: check whether can submit a doorbell request to raise
+      * a doorbell fence to exit gfxoff.
+      */
+     if (adev->in_s0ix)
+             amdgpu_gfx_off_ctrl(adev, false);
+
      return gfx_v10_0_hw_init(handle);
 }
 
@@ -7819,6 +7827,9 @@ static int gfx_v10_0_late_init(void *handle)
      struct amdgpu_device *adev = (struct amdgpu_device *)handle;
      int r;
 
+     if (adev->in_s0ix)
+              amdgpu_gfx_off_ctrl(adev, true);
+
      r = amdgpu_irq_get(adev, &adev->gfx.priv_reg_irq, 0);
      if (r)
              return r;
--

2.7.4