[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1573095656-749-1-git-send-email-peng.fan@nxp.com>
Date: Thu, 7 Nov 2019 03:02:34 +0000
From: Peng Fan <peng.fan@....com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"jslaby@...e.com" <jslaby@...e.com>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"festevam@...il.com" <festevam@...il.com>
CC: dl-linux-imx <linux-imx@....com>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andy Duan <fugang.duan@....com>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, Peng Fan <peng.fan@....com>
Subject: [PATCH] tty: serial: imx: use the sg count from dma_map_sg
From: Peng Fan <peng.fan@....com>
The dmaengine_prep_slave_sg needs to use sg count returned
by dma_map_sg, not use sport->dma_tx_nents, because the return
value of dma_map_sg is not always same with "nents".
And update sport->dma_tx_nents with value from dma_map_sg to avoid
modifing dma_unmap_sg
Fixes: b4cdc8f61beb("serial: imx: add DMA support for imx6q")
Signed-off-by: Peng Fan <peng.fan@....com>
---
drivers/tty/serial/imx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 87c58f9f6390..bda7f59ec60e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -619,6 +619,9 @@ static void imx_uart_dma_tx(struct imx_port *sport)
dev_err(dev, "DMA mapping error for TX.\n");
return;
}
+
+ sport->dma_tx_nents = ret;
+
desc = dmaengine_prep_slave_sg(chan, sgl, sport->dma_tx_nents,
DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT);
if (!desc) {
--
2.16.4
Powered by blists - more mailing lists