Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752687AbdGCHB2 (ORCPT ); Mon, 3 Jul 2017 03:01:28 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:56591 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbdGCHBZ (ORCPT ); Mon, 3 Jul 2017 03:01:25 -0400 Date: Mon, 3 Jul 2017 09:01:20 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Romain Perier Cc: Greg Kroah-Hartman , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nandor Han Subject: Re: [PATCH 5/7] serial: imx: umap sg buffers when DMA channel is released Message-ID: <20170703070120.j6fg2vfiikug4jmd@pengutronix.de> References: <20170630120446.13994-1-romain.perier@collabora.com> <20170630120446.13994-6-romain.perier@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170630120446.13994-6-romain.perier@collabora.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:5054:ff:fe2a:3aa X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1297 Lines: 42 $Subject ~= s/umap/unmap/ On Fri, Jun 30, 2017 at 02:04:44PM +0200, Romain Perier wrote: > From: Nandor Han > > This commits unmaps sg buffers when the DMA channel is released > > Signed-off-by: Nandor Han > Signed-off-by: Romain Perier > --- > drivers/tty/serial/imx.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > index e8cf7cf..58d6b1c 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -1215,6 +1215,12 @@ static void imx_stop_tx_dma(struct imx_port *sport) > temp = readl(sport->port.membase + UCR1); > temp &= ~UCR1_TDMAEN; > writel(temp, sport->port.membase + UCR1); > + > + if (sport->dma_is_txing) { > + dma_unmap_sg(sport->port.dev, &sport->tx_sgl[0], > + sport->dma_tx_nents, DMA_TO_DEVICE); > + sport->dma_is_txing = 0; You don't motivate setting dma_is_txing to zero in the commit log. Does this mean the driver leaks memory in the current state? > + } > } > > static void imx_stop_rx_dma(struct imx_port *sport) Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |