From 1f683b8531f6e20c3b242de5e11a991016a8e596 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 21 Jul 2023 09:39:53 +0200 Subject: [PATCH] 4.19-stable patches added patches: drm-amd-display-add-monitor-specific-edid-quirk.patch drm-amdgpu-fix-clearing-mappings-for-bos-that-are-always-valid-in-vm.patch serial-atmel-don-t-enable-irqs-prematurely.patch --- ...play-add-monitor-specific-edid-quirk.patch | 65 +++++++++++++++++++ ...-for-bos-that-are-always-valid-in-vm.patch | 62 ++++++++++++++++++ ...-atmel-don-t-enable-irqs-prematurely.patch | 45 +++++++++++++ queue-4.19/series | 3 + 4 files changed, 175 insertions(+) create mode 100644 queue-4.19/drm-amd-display-add-monitor-specific-edid-quirk.patch create mode 100644 queue-4.19/drm-amdgpu-fix-clearing-mappings-for-bos-that-are-always-valid-in-vm.patch create mode 100644 queue-4.19/serial-atmel-don-t-enable-irqs-prematurely.patch diff --git a/queue-4.19/drm-amd-display-add-monitor-specific-edid-quirk.patch b/queue-4.19/drm-amd-display-add-monitor-specific-edid-quirk.patch new file mode 100644 index 00000000000..6e28de4b47e --- /dev/null +++ b/queue-4.19/drm-amd-display-add-monitor-specific-edid-quirk.patch @@ -0,0 +1,65 @@ +From 613a7956deb3b1ffa2810c6d4c90ee9c3d743dbb Mon Sep 17 00:00:00 2001 +From: Aurabindo Pillai +Date: Mon, 12 Jun 2023 12:44:00 -0400 +Subject: drm/amd/display: Add monitor specific edid quirk + +From: Aurabindo Pillai + +commit 613a7956deb3b1ffa2810c6d4c90ee9c3d743dbb upstream. + +Disable FAMS on a Samsung Odyssey G9 monitor. Experiments show that this +monitor does not work well under some use cases, and is likely +implementation specific bug on the monitor's firmware. + +Cc: stable@vger.kernel.org +Reviewed-by: Rodrigo Siqueira +Signed-off-by: Aurabindo Pillai +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 26 ++++++++++++++ + 1 file changed, 26 insertions(+) + +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +@@ -41,6 +41,30 @@ + + #include "dm_helpers.h" + ++static u32 edid_extract_panel_id(struct edid *edid) ++{ ++ return (u32)edid->mfg_id[0] << 24 | ++ (u32)edid->mfg_id[1] << 16 | ++ (u32)EDID_PRODUCT_ID(edid); ++} ++ ++static void apply_edid_quirks(struct edid *edid, struct dc_edid_caps *edid_caps) ++{ ++ uint32_t panel_id = edid_extract_panel_id(edid); ++ ++ switch (panel_id) { ++ /* Workaround for some monitors which does not work well with FAMS */ ++ case drm_edid_encode_panel_id('S', 'A', 'M', 0x0E5E): ++ case drm_edid_encode_panel_id('S', 'A', 'M', 0x7053): ++ case drm_edid_encode_panel_id('S', 'A', 'M', 0x71AC): ++ DRM_DEBUG_DRIVER("Disabling FAMS on monitor with panel id %X\n", panel_id); ++ edid_caps->panel_patch.disable_fams = true; ++ break; ++ default: ++ return; ++ } ++} ++ + /* dm_helpers_parse_edid_caps + * + * Parse edid caps +@@ -126,6 +150,8 @@ enum dc_edid_status dm_helpers_parse_edi + else + edid_caps->speaker_flags = DEFAULT_SPEAKER_LOCATION; + ++ apply_edid_quirks(edid_buf, edid_caps); ++ + kfree(sads); + kfree(sadb); + diff --git a/queue-4.19/drm-amdgpu-fix-clearing-mappings-for-bos-that-are-always-valid-in-vm.patch b/queue-4.19/drm-amdgpu-fix-clearing-mappings-for-bos-that-are-always-valid-in-vm.patch new file mode 100644 index 00000000000..74c019bbb8b --- /dev/null +++ b/queue-4.19/drm-amdgpu-fix-clearing-mappings-for-bos-that-are-always-valid-in-vm.patch @@ -0,0 +1,62 @@ +From ea2c3c08554601b051d91403a241266e1cf490a5 Mon Sep 17 00:00:00 2001 +From: Samuel Pitoiset +Date: Fri, 16 Jun 2023 15:14:07 +0200 +Subject: drm/amdgpu: fix clearing mappings for BOs that are always valid in VM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Samuel Pitoiset + +commit ea2c3c08554601b051d91403a241266e1cf490a5 upstream. + +Per VM BOs must be marked as moved or otherwise their ranges are not +updated on use which might be necessary when the replace operation +splits mappings. + +This fixes random GPU hangs when replacing sparse mappings from the +userspace, while OP_MAP/OP_UNMAP works fine because always valid BOs +are correctly handled there. + +Cc: stable@vger.kernel.org +Signed-off-by: Samuel Pitoiset +Reviewed-by: Christian König +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +@@ -2315,18 +2315,30 @@ int amdgpu_vm_bo_clear_mappings(struct a + + /* Insert partial mapping before the range */ + if (!list_empty(&before->list)) { ++ struct amdgpu_bo *bo = before->bo_va->base.bo; ++ + amdgpu_vm_it_insert(before, &vm->va); + if (before->flags & AMDGPU_PTE_PRT) + amdgpu_vm_prt_get(adev); ++ ++ if (bo && bo->tbo.base.resv == vm->root.bo->tbo.base.resv && ++ !before->bo_va->base.moved) ++ amdgpu_vm_bo_moved(&before->bo_va->base); + } else { + kfree(before); + } + + /* Insert partial mapping after the range */ + if (!list_empty(&after->list)) { ++ struct amdgpu_bo *bo = after->bo_va->base.bo; ++ + amdgpu_vm_it_insert(after, &vm->va); + if (after->flags & AMDGPU_PTE_PRT) + amdgpu_vm_prt_get(adev); ++ ++ if (bo && bo->tbo.base.resv == vm->root.bo->tbo.base.resv && ++ !after->bo_va->base.moved) ++ amdgpu_vm_bo_moved(&after->bo_va->base); + } else { + kfree(after); + } diff --git a/queue-4.19/serial-atmel-don-t-enable-irqs-prematurely.patch b/queue-4.19/serial-atmel-don-t-enable-irqs-prematurely.patch new file mode 100644 index 00000000000..039f8368a29 --- /dev/null +++ b/queue-4.19/serial-atmel-don-t-enable-irqs-prematurely.patch @@ -0,0 +1,45 @@ +From 27a826837ec9a3e94cc44bd9328b8289b0fcecd7 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Mon, 19 Jun 2023 12:45:17 +0300 +Subject: serial: atmel: don't enable IRQs prematurely + +From: Dan Carpenter + +commit 27a826837ec9a3e94cc44bd9328b8289b0fcecd7 upstream. + +The atmel_complete_tx_dma() function disables IRQs at the start +of the function by calling spin_lock_irqsave(&port->lock, flags); +There is no need to disable them a second time using the +spin_lock_irq() function and, in fact, doing so is a bug because +it will enable IRQs prematurely when we call spin_unlock_irq(). + +Just use spin_lock/unlock() instead without disabling or enabling +IRQs. + +Fixes: 08f738be88bb ("serial: at91: add tx dma support") +Signed-off-by: Dan Carpenter +Reviewed-by: Jiri Slaby +Acked-by: Richard Genoud +Link: https://lore.kernel.org/r/cb7c39a9-c004-4673-92e1-be4e34b85368@moroto.mountain +Cc: stable +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/atmel_serial.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/atmel_serial.c ++++ b/drivers/tty/serial/atmel_serial.c +@@ -791,11 +791,11 @@ static void atmel_complete_tx_dma(void * + + port->icount.tx += atmel_port->tx_len; + +- spin_lock_irq(&atmel_port->lock_tx); ++ spin_lock(&atmel_port->lock_tx); + async_tx_ack(atmel_port->desc_tx); + atmel_port->cookie_tx = -EINVAL; + atmel_port->desc_tx = NULL; +- spin_unlock_irq(&atmel_port->lock_tx); ++ spin_unlock(&atmel_port->lock_tx); + + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + uart_write_wakeup(port); diff --git a/queue-4.19/series b/queue-4.19/series index 97321b5ef24..81be8cf040f 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -172,3 +172,6 @@ misc-pci_endpoint_test-free-irqs-before-removing-the-device.patch misc-pci_endpoint_test-re-init-completion-for-every-test.patch md-raid0-add-discard-support-for-the-original-layout.patch fs-dlm-return-positive-pid-value-for-f_getlk.patch +drm-amdgpu-fix-clearing-mappings-for-bos-that-are-always-valid-in-vm.patch +drm-amd-display-add-monitor-specific-edid-quirk.patch +serial-atmel-don-t-enable-irqs-prematurely.patch -- 2.47.3