All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume
@ 2022-10-21  2:29 Prike Liang
  2022-10-21 13:38 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Prike Liang @ 2022-10-21  2:29 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Prike Liang, Ray.Huang

In the S2idle suspend/resume phase the gfxoff is keeping functional so
some IP blocks will be likely to reinitialize at gfxoff entry and that
will result in failing to program GC registers.Therefore, let disallow
gfxoff until AMDGPU IPs reinitialized completely.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++++
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c  | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index e0445e8cc342..1624ed15fbc4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -4185,6 +4185,10 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
 	/* Make sure IB tests flushed */
 	flush_delayed_work(&adev->delayed_init_work);
 
+	if (adev->in_s0ix) {
+		amdgpu_gfx_off_ctrl(adev, true);
+		DRM_DEBUG("will enable gfxoff for the mission mode\n");
+	}
 	if (fbcon)
 		drm_fb_helper_set_suspend_unlocked(adev_to_drm(adev)->fb_helper, false);
 
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 4fe75dd2b329..3948dc5b1d6a 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1664,6 +1664,11 @@ static int smu_resume(void *handle)
 
 	dev_info(adev->dev, "SMU is resumed successfully!\n");
 
+	if (adev->in_s0ix) {
+		amdgpu_gfx_off_ctrl(adev, false);
+		dev_dbg(adev->dev, "will disable gfxoff for re-initializing other blocks\n");
+       }
+
 	return 0;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-21 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21  2:29 [PATCH] drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume Prike Liang
2022-10-21 13:38 ` Alex Deucher
2022-10-21 14:10   ` Liang, Prike
2022-10-21 14:18     ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.