]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 May 2023 07:26:15 +0000 (16:26 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 May 2023 07:26:15 +0000 (16:26 +0900)
added patches:
drm-amd-display-fix-flickering-caused-by-s-g-mode.patch
drm-amdgpu-disable-sdma-ecc-irq-only-when-sdma-ras-is-enabled-in-suspend.patch
drm-amdgpu-fix-an-amdgpu_irq_put-issue-in-gmc_v9_0_hw_fini.patch
drm-amdgpu-gfx-disable-gfx9-cp_ecc_error_irq-only-when-enabling-legacy-gfx-ras.patch

queue-5.10/drm-amd-display-fix-flickering-caused-by-s-g-mode.patch [new file with mode: 0644]
queue-5.10/drm-amdgpu-disable-sdma-ecc-irq-only-when-sdma-ras-is-enabled-in-suspend.patch [new file with mode: 0644]
queue-5.10/drm-amdgpu-fix-an-amdgpu_irq_put-issue-in-gmc_v9_0_hw_fini.patch [new file with mode: 0644]
queue-5.10/drm-amdgpu-gfx-disable-gfx9-cp_ecc_error_irq-only-when-enabling-legacy-gfx-ras.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/drm-amd-display-fix-flickering-caused-by-s-g-mode.patch b/queue-5.10/drm-amd-display-fix-flickering-caused-by-s-g-mode.patch
new file mode 100644 (file)
index 0000000..69c91a7
--- /dev/null
@@ -0,0 +1,58 @@
+From 08da182175db4c7f80850354849d95f2670e8cd9 Mon Sep 17 00:00:00 2001
+From: Hamza Mahfooz <hamza.mahfooz@amd.com>
+Date: Fri, 14 Apr 2023 14:26:27 -0400
+Subject: drm/amd/display: fix flickering caused by S/G mode
+
+From: Hamza Mahfooz <hamza.mahfooz@amd.com>
+
+commit 08da182175db4c7f80850354849d95f2670e8cd9 upstream.
+
+Currently, on a handful of ASICs. We allow the framebuffer for a given
+plane to exist in either VRAM or GTT. However, if the plane's new
+framebuffer is in a different memory domain than it's previous
+framebuffer, flipping between them can cause the screen to flicker. So,
+to fix this, don't perform an immediate flip in the aforementioned case.
+
+Cc: stable@vger.kernel.org
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2354
+Reviewed-by: Roman Li <Roman.Li@amd.com>
+Fixes: 81d0bcf99009 ("drm/amdgpu: make display pinning more flexible (v2)")
+Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -7180,6 +7180,13 @@ static void amdgpu_dm_commit_cursors(str
+                       handle_cursor_update(plane, old_plane_state);
+ }
++static inline uint32_t get_mem_type(struct drm_framebuffer *fb)
++{
++      struct amdgpu_bo *abo = gem_to_amdgpu_bo(fb->obj[0]);
++
++      return abo->tbo.resource ? abo->tbo.resource->mem_type : 0;
++}
++
+ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
+                                   struct dc_state *dc_state,
+                                   struct drm_device *dev,
+@@ -7300,11 +7307,13 @@ static void amdgpu_dm_commit_planes(stru
+               /*
+                * Only allow immediate flips for fast updates that don't
+-               * change FB pitch, DCC state, rotation or mirroing.
++               * change memory domain, FB pitch, DCC state, rotation or
++               * mirroring.
+                */
+               bundle->flip_addrs[planes_count].flip_immediate =
+                       crtc->state->async_flip &&
+-                      acrtc_state->update_type == UPDATE_TYPE_FAST;
++                      acrtc_state->update_type == UPDATE_TYPE_FAST &&
++                      get_mem_type(old_plane_state->fb) == get_mem_type(fb);
+               timestamp_ns = ktime_get_ns();
+               bundle->flip_addrs[planes_count].flip_timestamp_in_us = div_u64(timestamp_ns, 1000);
diff --git a/queue-5.10/drm-amdgpu-disable-sdma-ecc-irq-only-when-sdma-ras-is-enabled-in-suspend.patch b/queue-5.10/drm-amdgpu-disable-sdma-ecc-irq-only-when-sdma-ras-is-enabled-in-suspend.patch
new file mode 100644 (file)
index 0000000..d8bd64b
--- /dev/null
@@ -0,0 +1,60 @@
+From 8b229ada2669b74fdae06c83fbfda5a5a99fc253 Mon Sep 17 00:00:00 2001
+From: Guchun Chen <guchun.chen@amd.com>
+Date: Sat, 6 May 2023 16:52:59 +0800
+Subject: drm/amdgpu: disable sdma ecc irq only when sdma RAS is enabled in suspend
+
+From: Guchun Chen <guchun.chen@amd.com>
+
+commit 8b229ada2669b74fdae06c83fbfda5a5a99fc253 upstream.
+
+sdma_v4_0_ip is shared on a few asics, but in sdma_v4_0_hw_fini,
+driver unconditionally disables ecc_irq which is only enabled on
+those asics enabling sdma ecc. This will introduce a warning in
+suspend cycle on those chips with sdma ip v4.0, while without
+sdma ecc. So this patch correct this.
+
+[ 7283.166354] RIP: 0010:amdgpu_irq_put+0x45/0x70 [amdgpu]
+[ 7283.167001] RSP: 0018:ffff9a5fc3967d08 EFLAGS: 00010246
+[ 7283.167019] RAX: ffff98d88afd3770 RBX: 0000000000000001 RCX: 0000000000000000
+[ 7283.167023] RDX: 0000000000000000 RSI: ffff98d89da30390 RDI: ffff98d89da20000
+[ 7283.167025] RBP: ffff98d89da20000 R08: 0000000000036838 R09: 0000000000000006
+[ 7283.167028] R10: ffffd5764243c008 R11: 0000000000000000 R12: ffff98d89da30390
+[ 7283.167030] R13: ffff98d89da38978 R14: ffffffff999ae15a R15: ffff98d880130105
+[ 7283.167032] FS:  0000000000000000(0000) GS:ffff98d996f00000(0000) knlGS:0000000000000000
+[ 7283.167036] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+[ 7283.167039] CR2: 00000000f7a9d178 CR3: 00000001c42ea000 CR4: 00000000003506e0
+[ 7283.167041] Call Trace:
+[ 7283.167046]  <TASK>
+[ 7283.167048]  sdma_v4_0_hw_fini+0x38/0xa0 [amdgpu]
+[ 7283.167704]  amdgpu_device_ip_suspend_phase2+0x101/0x1a0 [amdgpu]
+[ 7283.168296]  amdgpu_device_suspend+0x103/0x180 [amdgpu]
+[ 7283.168875]  amdgpu_pmops_freeze+0x21/0x60 [amdgpu]
+[ 7283.169464]  pci_pm_freeze+0x54/0xc0
+
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2522
+Signed-off-by: Guchun Chen <guchun.chen@amd.com>
+Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c |    8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+@@ -1979,9 +1979,11 @@ static int sdma_v4_0_hw_fini(void *handl
+       if (amdgpu_sriov_vf(adev))
+               return 0;
+-      for (i = 0; i < adev->sdma.num_instances; i++) {
+-              amdgpu_irq_put(adev, &adev->sdma.ecc_irq,
+-                             AMDGPU_SDMA_IRQ_INSTANCE0 + i);
++      if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__SDMA)) {
++              for (i = 0; i < adev->sdma.num_instances; i++) {
++                      amdgpu_irq_put(adev, &adev->sdma.ecc_irq,
++                                     AMDGPU_SDMA_IRQ_INSTANCE0 + i);
++              }
+       }
+       sdma_v4_0_ctx_switch_enable(adev, false);
diff --git a/queue-5.10/drm-amdgpu-fix-an-amdgpu_irq_put-issue-in-gmc_v9_0_hw_fini.patch b/queue-5.10/drm-amdgpu-fix-an-amdgpu_irq_put-issue-in-gmc_v9_0_hw_fini.patch
new file mode 100644 (file)
index 0000000..1c75ab2
--- /dev/null
@@ -0,0 +1,36 @@
+From 922a76ba31adf84e72bc947267385be420c689ee Mon Sep 17 00:00:00 2001
+From: Hamza Mahfooz <hamza.mahfooz@amd.com>
+Date: Tue, 2 May 2023 11:59:08 -0400
+Subject: drm/amdgpu: fix an amdgpu_irq_put() issue in gmc_v9_0_hw_fini()
+
+From: Hamza Mahfooz <hamza.mahfooz@amd.com>
+
+commit 922a76ba31adf84e72bc947267385be420c689ee upstream.
+
+As made mention of in commit 08c677cb0b43 ("drm/amdgpu: fix
+amdgpu_irq_put call trace in gmc_v10_0_hw_fini") and commit 13af556104fa
+("drm/amdgpu: fix amdgpu_irq_put call trace in gmc_v11_0_hw_fini"). It
+is meaningless to call amdgpu_irq_put() for gmc.ecc_irq. So, remove it
+from gmc_v9_0_hw_fini().
+
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2522
+Fixes: 3029c855d79f ("drm/amdgpu: Fix desktop freezed after gpu-reset")
+Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
+Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+@@ -1686,7 +1686,6 @@ static int gmc_v9_0_hw_fini(void *handle
+               return 0;
+       }
+-      amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
+       amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
+       return 0;
diff --git a/queue-5.10/drm-amdgpu-gfx-disable-gfx9-cp_ecc_error_irq-only-when-enabling-legacy-gfx-ras.patch b/queue-5.10/drm-amdgpu-gfx-disable-gfx9-cp_ecc_error_irq-only-when-enabling-legacy-gfx-ras.patch
new file mode 100644 (file)
index 0000000..fb94417
--- /dev/null
@@ -0,0 +1,59 @@
+From 4a76680311330aefe5074bed8f06afa354b85c48 Mon Sep 17 00:00:00 2001
+From: Guchun Chen <guchun.chen@amd.com>
+Date: Sat, 6 May 2023 20:06:45 +0800
+Subject: drm/amdgpu/gfx: disable gfx9 cp_ecc_error_irq only when enabling legacy gfx ras
+
+From: Guchun Chen <guchun.chen@amd.com>
+
+commit 4a76680311330aefe5074bed8f06afa354b85c48 upstream.
+
+gfx9 cp_ecc_error_irq is only enabled when legacy gfx ras is assert.
+So in gfx_v9_0_hw_fini, interrupt disablement for cp_ecc_error_irq
+should be executed under such condition, otherwise, an amdgpu_irq_put
+calltrace will occur.
+
+[ 7283.170322] RIP: 0010:amdgpu_irq_put+0x45/0x70 [amdgpu]
+[ 7283.170964] RSP: 0018:ffff9a5fc3967d00 EFLAGS: 00010246
+[ 7283.170967] RAX: ffff98d88afd3040 RBX: ffff98d89da20000 RCX: 0000000000000000
+[ 7283.170969] RDX: 0000000000000000 RSI: ffff98d89da2bef8 RDI: ffff98d89da20000
+[ 7283.170971] RBP: ffff98d89da20000 R08: ffff98d89da2ca18 R09: 0000000000000006
+[ 7283.170973] R10: ffffd5764243c008 R11: 0000000000000000 R12: 0000000000001050
+[ 7283.170975] R13: ffff98d89da38978 R14: ffffffff999ae15a R15: ffff98d880130105
+[ 7283.170978] FS:  0000000000000000(0000) GS:ffff98d996f00000(0000) knlGS:0000000000000000
+[ 7283.170981] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+[ 7283.170983] CR2: 00000000f7a9d178 CR3: 00000001c42ea000 CR4: 00000000003506e0
+[ 7283.170986] Call Trace:
+[ 7283.170988]  <TASK>
+[ 7283.170989]  gfx_v9_0_hw_fini+0x1c/0x6d0 [amdgpu]
+[ 7283.171655]  amdgpu_device_ip_suspend_phase2+0x101/0x1a0 [amdgpu]
+[ 7283.172245]  amdgpu_device_suspend+0x103/0x180 [amdgpu]
+[ 7283.172823]  amdgpu_pmops_freeze+0x21/0x60 [amdgpu]
+[ 7283.173412]  pci_pm_freeze+0x54/0xc0
+[ 7283.173419]  ? __pfx_pci_pm_freeze+0x10/0x10
+[ 7283.173425]  dpm_run_callback+0x98/0x200
+[ 7283.173430]  __device_suspend+0x164/0x5f0
+
+v2: drop gfx11 as it's fixed in a different solution by retiring cp_ecc_irq funcs(Hawking)
+
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2522
+Signed-off-by: Guchun Chen <guchun.chen@amd.com>
+Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+@@ -3943,7 +3943,8 @@ static int gfx_v9_0_hw_fini(void *handle
+ {
+       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+-      amdgpu_irq_put(adev, &adev->gfx.cp_ecc_error_irq, 0);
++      if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX))
++              amdgpu_irq_put(adev, &adev->gfx.cp_ecc_error_irq, 0);
+       amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0);
+       amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0);
index 08f16faefb3b20a6c4d9fc4ff325e7dd940cff4e..b75c9a298c78d386bbb3d218e83a17e92b6e6688 100644 (file)
@@ -353,3 +353,7 @@ arm-dts-exynos-fix-wm8960-clock-name-in-itop-elite.patch
 arm-dts-s5pv210-correct-mipi-csis-clock-name.patch
 f2fs-fix-potential-corruption-when-moving-a-directory.patch
 drm-panel-otm8009a-set-backlight-parent-to-panel-device.patch
+drm-amd-display-fix-flickering-caused-by-s-g-mode.patch
+drm-amdgpu-fix-an-amdgpu_irq_put-issue-in-gmc_v9_0_hw_fini.patch
+drm-amdgpu-gfx-disable-gfx9-cp_ecc_error_irq-only-when-enabling-legacy-gfx-ras.patch
+drm-amdgpu-disable-sdma-ecc-irq-only-when-sdma-ras-is-enabled-in-suspend.patch