tty: serial: imx: add peripheral_config/peripheral_size for config
authorRobin Gong <yibin.gong@nxp.com>
Tue, 23 Mar 2021 17:02:44 +0000 (01:02 +0800)
committerRobin Gong <yibin.gong@nxp.com>
Wed, 21 Apr 2021 17:30:50 +0000 (01:30 +0800)
Add peripheral_config/peripheral_size for sdma, otherwise, the random
value of local variable slave_config may cause unexpected
peripheral_config and make sdma mess up.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Sherry Sun <sherry.sun@nxp.com>
(cherry picked from commit ba33de1c9535416f702fbf8bcbcef17f9cced409)

drivers/tty/serial/imx.c

index 61e357a..99cf613 100644 (file)
@@ -1356,6 +1356,8 @@ static int imx_uart_dma_init(struct imx_port *sport)
        slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
        /* one byte less than the watermark level to enable the aging timer */
        slave_config.src_maxburst = RXTL_DMA - 1;
+       slave_config.peripheral_config = NULL;
+       slave_config.peripheral_size = 0;
        ret = dmaengine_slave_config(sport->dma_chan_rx, &slave_config);
        if (ret) {
                dev_err(dev, "error in RX dma configuration.\n");
@@ -1381,6 +1383,8 @@ static int imx_uart_dma_init(struct imx_port *sport)
        slave_config.dst_addr = sport->port.mapbase + URTX0;
        slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
        slave_config.dst_maxburst = TXTL_DMA;
+       slave_config.peripheral_config = NULL;
+       slave_config.peripheral_size = 0;
        ret = dmaengine_slave_config(sport->dma_chan_tx, &slave_config);
        if (ret) {
                dev_err(dev, "error in TX dma configuration.");