]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Mar 2023 09:15:38 +0000 (10:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Mar 2023 09:15:38 +0000 (10:15 +0100)
added patches:
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

queue-5.15/serial-8250_em-fix-uart-port-type.patch [new file with mode: 0644]
queue-5.15/serial-8250_fsl-fix-handle_irq-locking.patch [new file with mode: 0644]
queue-5.15/series
queue-5.15/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch [new file with mode: 0644]
queue-5.15/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch [new file with mode: 0644]

diff --git a/queue-5.15/serial-8250_em-fix-uart-port-type.patch b/queue-5.15/serial-8250_em-fix-uart-port-type.patch
new file mode 100644 (file)
index 0000000..abf7b13
--- /dev/null
@@ -0,0 +1,36 @@
+From 32e293be736b853f168cd065d9cbc1b0c69f545d Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das.jz@bp.renesas.com>
+Date: Mon, 27 Feb 2023 11:41:46 +0000
+Subject: serial: 8250_em: Fix UART port type
+
+From: Biju Das <biju.das.jz@bp.renesas.com>
+
+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 <biju.das.jz@bp.renesas.com>
+Link: https://lore.kernel.org/r/20230227114152.22265-2-biju.das.jz@bp.renesas.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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-5.15/serial-8250_fsl-fix-handle_irq-locking.patch b/queue-5.15/serial-8250_fsl-fix-handle_irq-locking.patch
new file mode 100644 (file)
index 0000000..3fac5b6
--- /dev/null
@@ -0,0 +1,50 @@
+From 6e01f9a594ee0f69fb52cc8d11971612b4817f0b Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 27 Feb 2023 09:50:46 +0100
+Subject: serial: 8250_fsl: fix handle_irq locking
+
+From: Johan Hovold <johan@kernel.org>
+
+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 <error27@gmail.com>
+Link: https://lore.kernel.org/r/Y/xYzqp4ogmOF5t0@kili
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Acked-by: Jiri Slaby <jirislaby@kernel.org>
+Link: https://lore.kernel.org/r/20230227085046.24282-1-johan@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+@@ -38,7 +38,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;
+       }
+@@ -46,7 +46,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;
+       }
index 04d500b0967c40fb97973e88f66be653d44bdba2..2e3dbc8d6fcc9355564cf35f2c41010aefc79ea7 100644 (file)
@@ -71,3 +71,7 @@ net-9p-fix-bug-in-client-create-for-.l.patch
 sh-intc-avoid-spurious-sizeof-pointer-div-warning.patch
 drm-amd-display-fix-shift-out-of-bounds-in-calculate.patch
 ext4-fix-possible-double-unlock-when-moving-a-directory.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
+tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch
diff --git a/queue-5.15/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch b/queue-5.15/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch
new file mode 100644 (file)
index 0000000..b051fa4
--- /dev/null
@@ -0,0 +1,46 @@
+From 2411fd94ceaa6e11326e95d6ebf876cbfed28d23 Mon Sep 17 00:00:00 2001
+From: Sherry Sun <sherry.sun@nxp.com>
+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 <sherry.sun@nxp.com>
+
+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 <sherry.sun@nxp.com>
+Cc: stable <stable@kernel.org>
+Link: https://lore.kernel.org/r/20230223093941.31790-1-sherry.sun@nxp.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+@@ -2201,9 +2201,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-5.15/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch b/queue-5.15/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch
new file mode 100644 (file)
index 0000000..119146f
--- /dev/null
@@ -0,0 +1,33 @@
+From d8aca2f96813d51df574a811eda9a2cbed00f261 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Date: Thu, 29 Dec 2022 16:50:17 +0100
+Subject: tty: serial: qcom-geni-serial: stop operations in progress at shutdown
+
+From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+
+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 <bartosz.golaszewski@linaro.org>
+Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
+Link: https://lore.kernel.org/r/20221229155030.418800-2-brgl@bgdev.pl
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+@@ -893,6 +893,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)