From: Greg Kroah-Hartman Date: Mon, 1 Jul 2024 14:08:47 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v4.19.317~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e54ba3ff909e32f6b9fc06ff1c408c5b27134bd7;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: serial-8250_omap-implementation-of-errata-i2310.patch serial-imx-set-receiver-level-before-starting-uart.patch --- diff --git a/queue-5.15/serial-8250_omap-implementation-of-errata-i2310.patch b/queue-5.15/serial-8250_omap-implementation-of-errata-i2310.patch new file mode 100644 index 00000000000..867c859ded4 --- /dev/null +++ b/queue-5.15/serial-8250_omap-implementation-of-errata-i2310.patch @@ -0,0 +1,67 @@ +From 9d141c1e615795eeb93cd35501ad144ee997a826 Mon Sep 17 00:00:00 2001 +From: Udit Kumar +Date: Wed, 19 Jun 2024 16:29:03 +0530 +Subject: serial: 8250_omap: Implementation of Errata i2310 + +From: Udit Kumar + +commit 9d141c1e615795eeb93cd35501ad144ee997a826 upstream. + +As per Errata i2310[0], Erroneous timeout can be triggered, +if this Erroneous interrupt is not cleared then it may leads +to storm of interrupts, therefore apply Errata i2310 solution. + +[0] https://www.ti.com/lit/pdf/sprz536 page 23 + +Fixes: b67e830d38fa ("serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs") +Cc: stable@vger.kernel.org +Signed-off-by: Udit Kumar +Link: https://lore.kernel.org/r/20240619105903.165434-1-u-kumar1@ti.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/8250_omap.c | 25 ++++++++++++++++++++----- + 1 file changed, 20 insertions(+), 5 deletions(-) + +--- a/drivers/tty/serial/8250/8250_omap.c ++++ b/drivers/tty/serial/8250/8250_omap.c +@@ -159,6 +159,10 @@ static u32 uart_read(struct omap8250_pri + return readl(priv->membase + (reg << OMAP_UART_REGSHIFT)); + } + ++/* Timeout low and High */ ++#define UART_OMAP_TO_L 0x26 ++#define UART_OMAP_TO_H 0x27 ++ + /* + * Called on runtime PM resume path from omap8250_restore_regs(), and + * omap8250_set_mctrl(). +@@ -642,13 +646,24 @@ static irqreturn_t omap8250_irq(int irq, + + /* + * On K3 SoCs, it is observed that RX TIMEOUT is signalled after +- * FIFO has been drained, in which case a dummy read of RX FIFO +- * is required to clear RX TIMEOUT condition. ++ * FIFO has been drained or erroneously. ++ * So apply solution of Errata i2310 as mentioned in ++ * https://www.ti.com/lit/pdf/sprz536 + */ + if (priv->habit & UART_RX_TIMEOUT_QUIRK && +- (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT && +- serial_port_in(port, UART_OMAP_RX_LVL) == 0) { +- serial_port_in(port, UART_RX); ++ (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT) { ++ unsigned char efr2, timeout_h, timeout_l; ++ ++ efr2 = serial_in(up, UART_OMAP_EFR2); ++ timeout_h = serial_in(up, UART_OMAP_TO_H); ++ timeout_l = serial_in(up, UART_OMAP_TO_L); ++ serial_out(up, UART_OMAP_TO_H, 0xFF); ++ serial_out(up, UART_OMAP_TO_L, 0xFF); ++ serial_out(up, UART_OMAP_EFR2, UART_OMAP_EFR2_TIMEOUT_BEHAVE); ++ serial_in(up, UART_IIR); ++ serial_out(up, UART_OMAP_EFR2, efr2); ++ serial_out(up, UART_OMAP_TO_H, timeout_h); ++ serial_out(up, UART_OMAP_TO_L, timeout_l); + } + + /* Stop processing interrupts on input overrun */ diff --git a/queue-5.15/serial-imx-set-receiver-level-before-starting-uart.patch b/queue-5.15/serial-imx-set-receiver-level-before-starting-uart.patch new file mode 100644 index 00000000000..f8996456576 --- /dev/null +++ b/queue-5.15/serial-imx-set-receiver-level-before-starting-uart.patch @@ -0,0 +1,37 @@ +From a81dbd0463eca317eee44985a66aa6cc2ce5c101 Mon Sep 17 00:00:00 2001 +From: Stefan Eichenberger +Date: Fri, 21 Jun 2024 17:37:49 +0200 +Subject: serial: imx: set receiver level before starting uart + +From: Stefan Eichenberger + +commit a81dbd0463eca317eee44985a66aa6cc2ce5c101 upstream. + +Set the receiver level to something > 0 before calling imx_uart_start_rx +in rs485_config. This is necessary to avoid an interrupt storm that +might prevent the system from booting. This was seen on an i.MX7 device +when the rs485-rts-active-low property was active in the device tree. + +Fixes: 6d215f83e5fc ("serial: imx: warn user when using unsupported configuration") +Cc: stable +Signed-off-by: Stefan Eichenberger +Link: https://lore.kernel.org/r/20240621153829.183780-1-eichest@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/imx.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/tty/serial/imx.c ++++ b/drivers/tty/serial/imx.c +@@ -1972,8 +1972,10 @@ static int imx_uart_rs485_config(struct + + /* Make sure Rx is enabled in case Tx is active with Rx disabled */ + if (!(rs485conf->flags & SER_RS485_ENABLED) || +- rs485conf->flags & SER_RS485_RX_DURING_TX) ++ rs485conf->flags & SER_RS485_RX_DURING_TX) { ++ imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); + imx_uart_start_rx(port); ++ } + + port->rs485 = *rs485conf; + diff --git a/queue-5.15/series b/queue-5.15/series index daadc832784..0462585a53c 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -352,3 +352,5 @@ usb-gadget-printer-fix-races-against-disable.patch usb-musb-da8xx-fix-a-resource-leak-in-probe.patch usb-atm-cxacru-fix-endpoint-checking-in-cxacru_bind.patch usb-dwc3-core-remove-lock-of-otg-mode-during-gadget-suspend-resume-to-avoid-deadlock.patch +serial-8250_omap-implementation-of-errata-i2310.patch +serial-imx-set-receiver-level-before-starting-uart.patch