]> git.baikalelectronics.ru Git - kernel.git/commitdiff
serial: imx: fix overrun interrupts in DMA mode
authorJohan Hovold <johan@kernel.org>
Mon, 11 Apr 2022 08:19:57 +0000 (10:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 07:14:29 +0000 (09:14 +0200)
commit 11abf6c14fd4d6f8976429c82c3bcc3248eb7622 upstream.

Commit cf3d96106ba5 ("serial: imx: ensure that RX irqs are off if RX is
off") accidentally enabled overrun interrupts unconditionally when
deferring DMA enable until after the receiver has been enabled during
startup.

Fix this by using the DMA-initialised instead of DMA-enabled flag to
determine whether overrun interrupts should be enabled.

Note that overrun interrupts are already accounted for in
imx_uart_clear_rx_errors() when using DMA since commit b321cca15d20
("serial: imx-serial - update RX error counters when DMA is used").

Fixes: cf3d96106ba5 ("serial: imx: ensure that RX irqs are off if RX is off")
Cc: stable@vger.kernel.org # 4.17
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20220411081957.7846-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index 7820049aba5af2c068f6c1a3a8ff72cfd797ea68..b7ef075a4005b372706173c38961bf1d2d187d21 100644 (file)
@@ -1438,7 +1438,7 @@ static int imx_uart_startup(struct uart_port *port)
        imx_uart_writel(sport, ucr1, UCR1);
 
        ucr4 = imx_uart_readl(sport, UCR4) & ~(UCR4_OREN | UCR4_INVR);
-       if (!sport->dma_is_enabled)
+       if (!dma_is_inited)
                ucr4 |= UCR4_OREN;
        if (sport->inverted_rx)
                ucr4 |= UCR4_INVR;