]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
serial: imx: set receiver level before starting uart
authorStefan Eichenberger <stefan.eichenberger@toradex.com>
Fri, 21 Jun 2024 15:37:49 +0000 (17:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:34:00 +0000 (09:34 +0200)
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 <stable@kernel.org>
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Link: https://lore.kernel.org/r/20240621153829.183780-1-eichest@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index a1476e47c6aab6a1ba8072f4dd2432536eb5571c..5221863bce2e7ed4eca0df4230895403acd45f72 100644 (file)
@@ -1959,8 +1959,10 @@ static int imx_uart_rs485_config(struct uart_port *port, struct ktermios *termio
 
        /* 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);
+       }
 
        return 0;
 }