From b0fd2a25e9afc87fe87b95fad1f7535fe194d057 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 20 Mar 2023 10:15:26 +0100 Subject: [PATCH] 5.10-stable patches added patches: serial-8250_em-fix-uart-port-type.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 --- .../serial-8250_em-fix-uart-port-type.patch | 36 +++++++++++++++ queue-5.10/series | 3 ++ ...mplete-when-uartctrl_sbk-is-asserted.patch | 46 +++++++++++++++++++ ...p-operations-in-progress-at-shutdown.patch | 33 +++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 queue-5.10/serial-8250_em-fix-uart-port-type.patch create mode 100644 queue-5.10/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch create mode 100644 queue-5.10/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch diff --git a/queue-5.10/serial-8250_em-fix-uart-port-type.patch b/queue-5.10/serial-8250_em-fix-uart-port-type.patch new file mode 100644 index 00000000000..abf7b131abc --- /dev/null +++ b/queue-5.10/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-5.10/series b/queue-5.10/series index ae995ae8f0b..7b424e4da20 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -54,3 +54,6 @@ drm-amdkfd-fix-an-illegal-memory-access.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 +tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch diff --git a/queue-5.10/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch b/queue-5.10/tty-serial-fsl_lpuart-skip-waiting-for-transmission-complete-when-uartctrl_sbk-is-asserted.patch new file mode 100644 index 00000000000..b61b8d1a385 --- /dev/null +++ b/queue-5.10/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 +@@ -2159,9 +2159,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.10/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch b/queue-5.10/tty-serial-qcom-geni-serial-stop-operations-in-progress-at-shutdown.patch new file mode 100644 index 00000000000..119146fa99a --- /dev/null +++ b/queue-5.10/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 +@@ -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) -- 2.47.3