[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DB7PR04MB4490A84F6E06BD2D54261A9688780@DB7PR04MB4490.eurprd04.prod.outlook.com>
Date: Thu, 7 Nov 2019 06:37:28 +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>
Subject: RE: [PATCH] tty: serial: imx: use the sg count from dma_map_sg
> Subject: [PATCH] tty: serial: imx: use the sg count from dma_map_sg
Ignore this patch. Wrong fix, will have V2.
Thanks,
Peng.
>
> 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