[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220803065737.14752-1-sherry.sun@nxp.com>
Date: Wed, 3 Aug 2022 14:57:37 +0800
From: Sherry Sun <sherry.sun@....com>
To: gregkh@...uxfoundation.org, jirislaby@...nel.org,
shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
festevam@...il.com
Cc: linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-imx@....com
Subject: [PATCH] tty: serial: imx: initialize peripheral_config/peripheral_size for sdma config
Since commit 824a0a02cd74 ("dmaengine: imx-sdma: Add multi fifo support")
adds the use of dma_slave_config->peripheral_config/peripheral_size to
sdma driver, the client drivers like uart need to initialize the
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: Sherry Sun <sherry.sun@....com>
---
drivers/tty/serial/imx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 522445a8f666..bb8c2a712e94 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1320,6 +1320,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");
@@ -1346,6 +1348,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.");
--
2.17.1
Powered by blists - more mailing lists