From: Greg Kroah-Hartman Date: Mon, 20 Mar 2023 09:15:48 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v4.14.311~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d52d60f70d0209f330b2f08bf8e5d6bcd8560f5;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: revert-tty-serial-fsl_lpuart-adjust-serial_fsl_lpuart_console-config-dependency.patch serial-8250-aspeed_vuart-select-regmap-instead-of-depending-on-it.patch serial-8250_em-fix-uart-port-type.patch serial-8250_fsl-fix-handle_irq-locking.patch tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch --- diff --git a/queue-6.1/revert-tty-serial-fsl_lpuart-adjust-serial_fsl_lpuart_console-config-dependency.patch b/queue-6.1/revert-tty-serial-fsl_lpuart-adjust-serial_fsl_lpuart_console-config-dependency.patch new file mode 100644 index 00000000000..3f34a0fb5d3 --- /dev/null +++ b/queue-6.1/revert-tty-serial-fsl_lpuart-adjust-serial_fsl_lpuart_console-config-dependency.patch @@ -0,0 +1,46 @@ +From 2d638be71155b2e036aca1966b6129e2d661e91f Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Sun, 26 Feb 2023 12:38:46 -0500 +Subject: Revert "tty: serial: fsl_lpuart: adjust SERIAL_FSL_LPUART_CONSOLE config dependency" + +From: Tom Rix + +commit 2d638be71155b2e036aca1966b6129e2d661e91f upstream. + +This reverts commit 5779a072c248db7a40cfd0f5ea958097fd1d9a30. + +This results in a link error of + +ld: drivers/tty/serial/earlycon.o: in function `parse_options': +drivers/tty/serial/earlycon.c:99: undefined reference to `uart_parse_earlycon' + +When the config is in this state + +CONFIG_SERIAL_CORE=m +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_EARLYCON=y +CONFIG_SERIAL_FSL_LPUART=m +CONFIG_SERIAL_FSL_LPUART_CONSOLE=y + +Fixes: 5779a072c248 ("tty: serial: fsl_lpuart: adjust SERIAL_FSL_LPUART_CONSOLE config dependency") +Cc: stable +Signed-off-by: Tom Rix +Reviewed-by: Randy Dunlap +Acked-by: Jiri Slaby +Link: https://lore.kernel.org/r/20230226173846.236691-1-trix@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/tty/serial/Kconfig ++++ b/drivers/tty/serial/Kconfig +@@ -1311,7 +1311,7 @@ config SERIAL_FSL_LPUART + + config SERIAL_FSL_LPUART_CONSOLE + bool "Console on Freescale lpuart serial port" +- depends on SERIAL_FSL_LPUART ++ depends on SERIAL_FSL_LPUART=y + select SERIAL_CORE_CONSOLE + select SERIAL_EARLYCON + help diff --git a/queue-6.1/serial-8250-aspeed_vuart-select-regmap-instead-of-depending-on-it.patch b/queue-6.1/serial-8250-aspeed_vuart-select-regmap-instead-of-depending-on-it.patch new file mode 100644 index 00000000000..b93a461a3d9 --- /dev/null +++ b/queue-6.1/serial-8250-aspeed_vuart-select-regmap-instead-of-depending-on-it.patch @@ -0,0 +1,43 @@ +From f8086d1a65ac693e3fd863128352b4b11ee7324d Mon Sep 17 00:00:00 2001 +From: Randy Dunlap +Date: Sat, 25 Feb 2023 21:39:53 -0800 +Subject: serial: 8250: ASPEED_VUART: select REGMAP instead of depending on it + +From: Randy Dunlap + +commit f8086d1a65ac693e3fd863128352b4b11ee7324d upstream. + +REGMAP is a hidden (not user visible) symbol. Users cannot set it +directly thru "make *config", so drivers should select it instead of +depending on it if they need it. + +Consistently using "select" or "depends on" can also help reduce +Kconfig circular dependency issues. + +Therefore, change the use of "depends on REGMAP" to "select REGMAP". + +Fixes: 8d310c9107a2 ("drivers/tty/serial/8250: Make Aspeed VUART SIRQ polarity configurable") +Cc: stable +Signed-off-by: Randy Dunlap +Cc: Greg Kroah-Hartman +Cc: Oskar Senft +Cc: linux-serial@vger.kernel.org +Link: https://lore.kernel.org/r/20230226053953.4681-9-rdunlap@infradead.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/Kconfig | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/tty/serial/8250/Kconfig ++++ b/drivers/tty/serial/8250/Kconfig +@@ -253,8 +253,9 @@ config SERIAL_8250_ASPEED_VUART + tristate "Aspeed Virtual UART" + depends on SERIAL_8250 + depends on OF +- depends on REGMAP && MFD_SYSCON ++ depends on MFD_SYSCON + depends on ARCH_ASPEED || COMPILE_TEST ++ select REGMAP + help + If you want to use the virtual UART (VUART) device on Aspeed + BMC platforms, enable this option. This enables the 16550A- diff --git a/queue-6.1/serial-8250_em-fix-uart-port-type.patch b/queue-6.1/serial-8250_em-fix-uart-port-type.patch new file mode 100644 index 00000000000..abf7b131abc --- /dev/null +++ b/queue-6.1/serial-8250_em-fix-uart-port-type.patch @@ -0,0 +1,36 @@ +From 32e293be736b853f168cd065d9cbc1b0c69f545d Mon Sep 17 00:00:00 2001 +From: Biju Das +Date: Mon, 27 Feb 2023 11:41:46 +0000 +Subject: serial: 8250_em: Fix UART port type + +From: Biju Das + +commit 32e293be736b853f168cd065d9cbc1b0c69f545d upstream. + +As per HW manual for EMEV2 "R19UH0040EJ0400 Rev.4.00", the UART +IP found on EMMA mobile SoC is Register-compatible with the +general-purpose 16750 UART chip. Fix UART port type as 16750 and +enable 64-bytes fifo support. + +Fixes: 22886ee96895 ("serial8250-em: Emma Mobile UART driver V2") +Cc: stable@vger.kernel.org +Signed-off-by: Biju Das +Link: https://lore.kernel.org/r/20230227114152.22265-2-biju.das.jz@bp.renesas.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/8250_em.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/8250/8250_em.c ++++ b/drivers/tty/serial/8250/8250_em.c +@@ -106,8 +106,8 @@ static int serial8250_em_probe(struct pl + memset(&up, 0, sizeof(up)); + up.port.mapbase = regs->start; + up.port.irq = irq; +- up.port.type = PORT_UNKNOWN; +- up.port.flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_IOREMAP; ++ up.port.type = PORT_16750; ++ up.port.flags = UPF_FIXED_PORT | UPF_IOREMAP | UPF_FIXED_TYPE; + up.port.dev = &pdev->dev; + up.port.private_data = priv; + diff --git a/queue-6.1/serial-8250_fsl-fix-handle_irq-locking.patch b/queue-6.1/serial-8250_fsl-fix-handle_irq-locking.patch new file mode 100644 index 00000000000..4f3c7ef6bc7 --- /dev/null +++ b/queue-6.1/serial-8250_fsl-fix-handle_irq-locking.patch @@ -0,0 +1,50 @@ +From 6e01f9a594ee0f69fb52cc8d11971612b4817f0b Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 27 Feb 2023 09:50:46 +0100 +Subject: serial: 8250_fsl: fix handle_irq locking + +From: Johan Hovold + +commit 6e01f9a594ee0f69fb52cc8d11971612b4817f0b upstream. + +The 8250 handle_irq callback is not just called from the interrupt +handler but also from a timer callback when polling (e.g. for ports +without an interrupt line). Consequently the callback must explicitly +disable interrupts to avoid a potential deadlock with another interrupt +in polled mode. + +Fix up the two paths in the freescale callback that failed to re-enable +interrupts when polling. + +Fixes: 853a9ae29e97 ("serial: 8250: fix handle_irq locking") +Cc: stable@vger.kernel.org # 5.13 +Reported-by: Dan Carpenter +Link: https://lore.kernel.org/r/Y/xYzqp4ogmOF5t0@kili +Signed-off-by: Johan Hovold +Acked-by: Jiri Slaby +Link: https://lore.kernel.org/r/20230227085046.24282-1-johan@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/8250_fsl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/8250/8250_fsl.c ++++ b/drivers/tty/serial/8250/8250_fsl.c +@@ -34,7 +34,7 @@ int fsl8250_handle_irq(struct uart_port + + iir = port->serial_in(port, UART_IIR); + if (iir & UART_IIR_NO_INT) { +- spin_unlock(&up->port.lock); ++ spin_unlock_irqrestore(&up->port.lock, flags); + return 0; + } + +@@ -42,7 +42,7 @@ int fsl8250_handle_irq(struct uart_port + if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) { + up->lsr_saved_flags &= ~UART_LSR_BI; + port->serial_in(port, UART_RX); +- spin_unlock(&up->port.lock); ++ spin_unlock_irqrestore(&up->port.lock, flags); + return 1; + } + diff --git a/queue-6.1/series b/queue-6.1/series index a76db3935d2..094beb1fb0e 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -114,3 +114,9 @@ sh-intc-avoid-spurious-sizeof-pointer-div-warning.patch drm-amdgpu-fix-ttm_bo-calltrace-warning-in-psp_hw_fi.patch drm-amd-display-fix-shift-out-of-bounds-in-calculate.patch ext4-fix-possible-double-unlock-when-moving-a-directory.patch +revert-tty-serial-fsl_lpuart-adjust-serial_fsl_lpuart_console-config-dependency.patch +tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch +serial-8250_em-fix-uart-port-type.patch +serial-8250_fsl-fix-handle_irq-locking.patch +serial-8250-aspeed_vuart-select-regmap-instead-of-depending-on-it.patch +tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch diff --git a/queue-6.1/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch b/queue-6.1/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch new file mode 100644 index 00000000000..a5df33347c7 --- /dev/null +++ b/queue-6.1/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch @@ -0,0 +1,46 @@ +From 2411fd94ceaa6e11326e95d6ebf876cbfed28d23 Mon Sep 17 00:00:00 2001 +From: Sherry Sun +Date: Thu, 23 Feb 2023 17:39:41 +0800 +Subject: tty: serial: fsl_lpuart: skip waiting for transmission complete when UARTCTRL_SBK is asserted + +From: Sherry Sun + +commit 2411fd94ceaa6e11326e95d6ebf876cbfed28d23 upstream. + +According to LPUART RM, Transmission Complete Flag becomes 0 if queuing +a break character by writing 1 to CTRL[SBK], so here need to skip +waiting for transmission complete when UARTCTRL_SBK is asserted, +otherwise the kernel may stuck here. +And actually set_termios() adds transmission completion waiting to avoid +data loss or data breakage when changing the baud rate, but we don't +need to worry about this when queuing break characters. + +Signed-off-by: Sherry Sun +Cc: stable +Link: https://lore.kernel.org/r/20230223093941.31790-1-sherry.sun@nxp.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/fsl_lpuart.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/tty/serial/fsl_lpuart.c ++++ b/drivers/tty/serial/fsl_lpuart.c +@@ -2184,9 +2184,15 @@ lpuart32_set_termios(struct uart_port *p + /* update the per-port timeout */ + uart_update_timeout(port, termios->c_cflag, baud); + +- /* wait transmit engin complete */ +- lpuart32_write(&sport->port, 0, UARTMODIR); +- lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC); ++ /* ++ * LPUART Transmission Complete Flag may never be set while queuing a break ++ * character, so skip waiting for transmission complete when UARTCTRL_SBK is ++ * asserted. ++ */ ++ if (!(old_ctrl & UARTCTRL_SBK)) { ++ lpuart32_write(&sport->port, 0, UARTMODIR); ++ lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC); ++ } + + /* disable transmit and receive */ + lpuart32_write(&sport->port, old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE), diff --git a/queue-6.1/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch b/queue-6.1/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch new file mode 100644 index 00000000000..437626d7432 --- /dev/null +++ b/queue-6.1/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch @@ -0,0 +1,33 @@ +From d8aca2f96813d51df574a811eda9a2cbed00f261 Mon Sep 17 00:00:00 2001 +From: Bartosz Golaszewski +Date: Thu, 29 Dec 2022 16:50:17 +0100 +Subject: tty: serial: qcom-geni-serial: stop operations in progress at shutdown + +From: Bartosz Golaszewski + +commit d8aca2f96813d51df574a811eda9a2cbed00f261 upstream. + +We don't stop transmissions in progress at shutdown. This is fine with +FIFO SE mode but with DMA (support for which we'll introduce later) it +causes trouble so fix it now. + +Fixes: e83766334f96 ("tty: serial: qcom_geni_serial: No need to stop tx/rx on UART shutdown") +Signed-off-by: Bartosz Golaszewski +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20221229155030.418800-2-brgl@bgdev.pl +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/qcom_geni_serial.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/tty/serial/qcom_geni_serial.c ++++ b/drivers/tty/serial/qcom_geni_serial.c +@@ -891,6 +891,8 @@ static int setup_fifos(struct qcom_geni_ + static void qcom_geni_serial_shutdown(struct uart_port *uport) + { + disable_irq(uport->irq); ++ qcom_geni_serial_stop_tx(uport); ++ qcom_geni_serial_stop_rx(uport); + } + + static int qcom_geni_serial_port_setup(struct uart_port *uport)