serial: imx: setup fifo waterlevel before enabling aging timer
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 2 Mar 2018 10:07:24 +0000 (11:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2018 18:21:01 +0000 (10:21 -0800)
The aging timer fires if there are characters in the RX fifo but the
water level isn't reached yet. Make sure that the waterlevel is
configured before the aging timer is enabled to trigger a DMA request
(UCR1_ATDMAEN).

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index 23d591897e8247dafa132ac22ffb1b6b8bab3045..9b92c49fc1740733c25086273650bf88b09f0041 100644 (file)
@@ -1239,13 +1239,13 @@ static void imx_enable_dma(struct imx_port *sport)
 {
        u32 ucr1;
 
+       imx_setup_ufcr(sport, TXTL_DMA, RXTL_DMA);
+
        /* set UCR1 */
        ucr1 = imx_uart_readl(sport, UCR1);
        ucr1 |= UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN;
        imx_uart_writel(sport, ucr1, UCR1);
 
-       imx_setup_ufcr(sport, TXTL_DMA, RXTL_DMA);
-
        sport->dma_is_enabled = 1;
 }