summarylogtreecommitdiffstats
path: root/0041-flush_and_deleyed_gfxoff_on_suspend_amdgpu.patch
diff options
context:
space:
mode:
Diffstat (limited to '0041-flush_and_deleyed_gfxoff_on_suspend_amdgpu.patch')
-rw-r--r--0041-flush_and_deleyed_gfxoff_on_suspend_amdgpu.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/0041-flush_and_deleyed_gfxoff_on_suspend_amdgpu.patch b/0041-flush_and_deleyed_gfxoff_on_suspend_amdgpu.patch
new file mode 100644
index 000000000000..0fbbd454571c
--- /dev/null
+++ b/0041-flush_and_deleyed_gfxoff_on_suspend_amdgpu.patch
@@ -0,0 +1,66 @@
+From 98688e56430307f8069c6a7ed4bc301a5d08b9b7 Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Thu, 18 May 2023 11:52:51 -0500
+Subject: [PATCH] drm/amd: Flush any delayed gfxoff on suspend entry
+
+DCN 3.1.4 is reported to hang on s2idle entry if graphics activity
+is happening during entry. This is because GFXOFF was scheduled as
+delayed but RLC gets disabled in s2idle entry sequence which will
+hang GFX IP if not already in GFXOFF.
+
+To help this problem, flush any delayed work for GFXOFF early in
+s2idle entry sequence to ensure that it's off when RLC is changed.
+
+commit 3964b0c2e843 ("drm/amdgpu: complete gfxoff allow signal during
+suspend without delay") modified power gating flow so that if called
+in s0ix that it ensured that GFXOFF wasn't put in work queue but
+instead processed immediately.
+
+This is dead code due to commit 5d70a549d00d ("drm/amdgpu: skip
+CG/PG for gfx during S0ix") because GFXOFF will now not be explicitly
+called as part of the suspend entry code. Remove that dead code.
+
+Cc: stable@vger.kernel.org # 6.1+
+Suggested-by: Tim Huang <tim.huang@amd.com>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
+ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 9 +--------
+ 2 files changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+index 5c7d40873ee2..7721fe892847 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -4205,6 +4205,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
+ drm_fb_helper_set_suspend_unlocked(adev_to_drm(adev)->fb_helper, true);
+
+ cancel_delayed_work_sync(&adev->delayed_init_work);
++ flush_delayed_work(&adev->gfx.gfx_off_delay_work);
+
+ amdgpu_ras_suspend(adev);
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+index f3f541ba0aca..bff5b6eac39b 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+@@ -589,15 +589,8 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)
+
+ if (adev->gfx.gfx_off_req_count == 0 &&
+ !adev->gfx.gfx_off_state) {
+- /* If going to s2idle, no need to wait */
+- if (adev->in_s0ix) {
+- if (!amdgpu_dpm_set_powergating_by_smu(adev,
+- AMD_IP_BLOCK_TYPE_GFX, true))
+- adev->gfx.gfx_off_state = true;
+- } else {
+- schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
++ schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
+ delay);
+- }
+ }
+ } else {
+ if (adev->gfx.gfx_off_req_count == 0) {
+--
+GitLab
+