Received: by 10.192.165.148 with SMTP id m20csp4319911imm; Tue, 8 May 2018 06:41:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1ybi5ahCC2/f6UKoh3vHjuujeFvFDyMcsrBaiK3eh6ZGdVfWri0qSQKD/U0RTz9Qg2a2y X-Received: by 2002:a63:9401:: with SMTP id m1-v6mr32911395pge.140.1525786911232; Tue, 08 May 2018 06:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525786911; cv=none; d=google.com; s=arc-20160816; b=avT1y/JBgcrjhE6ElgFFCKYIF9jdqZdJ6hxaG7Z95hqVZtSGbLDMMSJFZurHPbkj0D XByDNXyDDxIn+tn4kWBPPWdDjm5emWQkaYfI8zN7ZjlOgS2kZMtDYYlwsFQizvgGftI3 M2/7aBomF16hj8do/BRmdtJsG6uJFGk6HdUyD5CMYdAqXcbK2CBtcAOnAGmrjmSPXEZC 2nav+0lkPrb7rDWcw5JzFUtqOygwuWhXFToaPMw4AZDa5NPXoBF7ClEMVCPYdtbdmAtY 6e++VYUvDI3SYGX1L4PkXZ37kPAbMFfKU4o2z1VRP/QoK0STCm6HZ83A1fJE+ZKfnIq0 SgUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Uyl8ARhade3ZvhmZion+UyHD/6ipCseCryig0JuBLTM=; b=MSQ4a2Uqxq4OZkG/jyZKKB7k0NHaWfcLNBZaDz8sGO72QacPDE4quJp6R9dZOfJWAM aw/OycKkUPqAOyxRxmCu7F1dQP06Nu5Lc0Cx4qPBlEnMC2Pgkgqj+SQVI87KQFgBLgB7 SN3gd08XJtXA4w1nWMO2MItZoN+Lsus3YXLCA7gFCyYJdqE3ZQ3TfLcpz0hUXYXJoRwD O4Dg2dhw2cQaOw26eb/Ypf3ozH10D6Vdpbmzx6m/buuNTi627f1MOrcav9w75kA725MR Oe1dI+DJO8O+BhkbP53VO22aO3+QQQbkHBA7wu8epWTT2ZPnnypFMOVb3tWmN8hCWCNE rlzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u11-v6si23252526plr.165.2018.05.08.06.41.36; Tue, 08 May 2018 06:41:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932530AbeEHNky (ORCPT + 99 others); Tue, 8 May 2018 09:40:54 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48758 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932104AbeEHNkw (ORCPT ); Tue, 8 May 2018 09:40:52 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id A805A26041D Date: Tue, 8 May 2018 15:40:47 +0200 From: Sebastian Reichel To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Fabio Estevam , Shawn Guo , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] serial: imx: dma_unmap_sg buffers on shutdown Message-ID: <20180508134047.zocurxwelw3a24ti@earth.universe> References: <20180507213610.17330-1-sebastian.reichel@collabora.co.uk> <20180507213610.17330-3-sebastian.reichel@collabora.co.uk> <20180508064351.ioczgw2v4jtryr3x@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6wb2m4rdd5yi7wpt" Content-Disposition: inline In-Reply-To: <20180508064351.ioczgw2v4jtryr3x@pengutronix.de> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6wb2m4rdd5yi7wpt Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, May 08, 2018 at 08:43:51AM +0200, Uwe Kleine-K=F6nig wrote: > On Mon, May 07, 2018 at 11:36:10PM +0200, Sebastian Reichel wrote: > > This properly unmaps DMA SG on device shutdown. > >=20 > > Reported-by: Nandor Han > > Suggested-by: Nandor Han > > Signed-off-by: Sebastian Reichel > > --- > > drivers/tty/serial/imx.c | 12 ++++++++++-- > > 1 file changed, 10 insertions(+), 2 deletions(-) > >=20 > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > > index 3ca767b1162a..6c53e74244ec 100644 > > --- a/drivers/tty/serial/imx.c > > +++ b/drivers/tty/serial/imx.c > > @@ -1425,10 +1425,18 @@ static void imx_uart_shutdown(struct uart_port = *port) > > u32 ucr1, ucr2; > > =20 > > if (sport->dma_is_enabled) { > > - sport->dma_is_rxing =3D 0; > > - sport->dma_is_txing =3D 0; > > dmaengine_terminate_sync(sport->dma_chan_tx); > > + 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 =3D 0; > > + } >=20 > did you find this because the kernel crashed or consumed more and more > memory, or is this "only" a finding of reading the source code? If the > former it would be great to point out in the commit log, if the latter, > I wonder if this is a real problem that warrants a stable backport. A bit of both. One of Collabora's customers had a (scarce) kernel crash in imx-serial and modified multiple things in the driver. The crash is gone, but it's not clear which change fixed it. I could not reproduce the crash so far and I'm currently rebasing and splitting their changes into upstreamable portions with proper patch descriptions. From reading the source this looked like a real issue. -- Sebastian --6wb2m4rdd5yi7wpt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlrxqN0ACgkQ2O7X88g7 +poWCxAApwb98MM1VPGr5cibDrJ6pXjGtIPTfVz+WOsUW48kopVs1HHs4p+o6LZm GB6j/4WvDQ6oG37WX+9b2URX+w76GzfDSpivNQw2b1nX/8m9tSn09vrGTfz2nFN+ j76CldlfNH9UYcz0ejUd2lcO0ESVji55H6YeFCRdBa3vrboN4Oh1eoMPZI+hOoI5 AX97Cjt/TEzYVpl+/F3SPvneRMrKfc81SDHL0f5NLMt4NXTx7qWh7ekRnjzDyjTs axm/Trh5hrMuYQmo32IKMafBYJuw2bPLQFc748VtU19AoZt3Y7yX0U6cGpWyM9RF WDMvEnotr3IEhw8Et041ReLMlPClOfO6e+6xUTjZnIuPMhzBsw+tI5z5x25tAGx+ GHEXihMsjysVptFLHWq/eyOxi5LC9DywMtzHa2ayYAZudiKIUbVjRlM+Fdziv00W TfLnx8b6ry1bpENooOzTY5k3Cb9u0UL81aHqM4ZdVhiMiaLY9cOpFPMv5D8SV7S5 HjtpDpeonXnbNPk1zkBfTNGp6RNtMZ3E1zbIUjX5N5vyO6d+k1UOAEUxFYbFhzGt HFjJx+iLTCGF/NLOp9QY0u13NDNYgmYBCkMTqGKZcsRYP/2qlR+QY9rHwilsLBnR NKCoIMV+qNLYtWoUE6l98HpuVmBadpGNLoPgGeohtg5t2ztnyos= =wYO1 -----END PGP SIGNATURE----- --6wb2m4rdd5yi7wpt--