Received: by 10.192.165.148 with SMTP id m20csp4644567imm; Tue, 8 May 2018 11:47:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoZiuwwRq7EcJk0e1ltBmXlAJCkSWrBodMGMocT6pk6ZOUOQgQhd4Liy4bzCWDSZ33l9gfU X-Received: by 2002:a63:7b47:: with SMTP id k7-v6mr33845191pgn.321.1525805238758; Tue, 08 May 2018 11:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525805238; cv=none; d=google.com; s=arc-20160816; b=uff1tDp8ZiBnXFmrEr1wr2hpQmIwqDmGpxUHbPCVyXAvhRnz7nHxEhj+VtIvPcXzjt xnUusx8KMaTeh4igbbrLAuEd4nz+jDY9bV3UZNylYb2JxndW4F1q3lqKcyV8C8Hq7wTj 0nT6158EFNNZ0xCtf6+DivQ5ReBSbgeUnJ33JQsXJhqbsITRFiWtEA/D7IBE1CYo6WW4 7rKOD9xogZsC7yHWctCh4QVtxCNIA7WuogyudP0xUVo+3AxhpSRLKt/O32mS+M5O8YsC BFNaUKQ0dmcQvtg9c6CNekh6FR7Li061vVDh/YxhlI3tAFq8iciBK4xJOXPlCWk/BNsH hdaw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=VGgIqivhLQwcDwaUj2yCXGvKY0/k+gMPP4jgDCgrLs8=; b=MzCt1DCrgZrSfh9n+FdR9JWeeE10u6v1gP+9huHkZ3MiAAqVONf0rU4kAoX6/L/8ud Mgvw2MphPOr3dTVh7ckbL4UDhb7N6M8ujzDRstI829HVMqD4FyzO8h/HeJF4KWQoNV/7 MDjMf/21swvjAsCv/BCeLJfCaI9Pcn6OsK1SoHQ+pMwFq39MF8o7l/2oHcSsibALTdt2 metlVn0V/891jMkXq32DLKZ6/VRd0BlWwKAPrJVSw8sB7yD1HWfsInl/csL1SN3YrT4L s7PFthYSjyujruRvr5rHkjlEtAforlUmHEQjw/Wjtpa2y96xGZXcxnFqFA8IRMzdBH93 R8Tw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t128-v6si10144638pgt.368.2018.05.08.11.46.54; Tue, 08 May 2018 11:47:18 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932593AbeEHSqm (ORCPT + 99 others); Tue, 8 May 2018 14:46:42 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:35317 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754655AbeEHSql (ORCPT ); Tue, 8 May 2018 14:46:41 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fG7dD-0005IY-Mb; Tue, 08 May 2018 20:46:35 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1fG7cq-0002cb-Oz; Tue, 08 May 2018 20:46:12 +0200 Date: Tue, 8 May 2018 20:46:12 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Sebastian Reichel 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: <20180508184612.iixr3psap4ik5fdr@pengutronix.de> References: <20180507213610.17330-1-sebastian.reichel@collabora.co.uk> <20180507213610.17330-3-sebastian.reichel@collabora.co.uk> <20180508064351.ioczgw2v4jtryr3x@pengutronix.de> <20180508134047.zocurxwelw3a24ti@earth.universe> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180508134047.zocurxwelw3a24ti@earth.universe> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Sebastian, On Tue, May 08, 2018 at 03:40:47PM +0200, Sebastian Reichel wrote: > On Tue, May 08, 2018 at 08:43:51AM +0200, Uwe Kleine-K?nig wrote: > > On Mon, May 07, 2018 at 11:36:10PM +0200, Sebastian Reichel wrote: > > > This properly unmaps DMA SG on device shutdown. > > > > > > 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(-) > > > > > > 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; > > > > > > if (sport->dma_is_enabled) { > > > - sport->dma_is_rxing = 0; > > > - sport->dma_is_txing = 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 = 0; > > > + } > > > > 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. In which context (kernel version, operating mode (e.g. rs485)) did these happen? What does "crash" mean? The kernel did just hang or produced an oops? If the latter, can you show it/them? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |