From patchwork Fri Oct 20 22:13:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 10021093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66CD860211 for ; Fri, 20 Oct 2017 22:14:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52D6528E5F for ; Fri, 20 Oct 2017 22:14:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44A2D28E88; Fri, 20 Oct 2017 22:14:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB19C28E5F for ; Fri, 20 Oct 2017 22:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=rRC5NPDASHkoBeIu3hAKsZQKqXsIsqyii5fLG9gHyP4=; b=IiA ILvmVvbWiR7CbWi+GeJ2rhp5e5vvQqcDqnUoyxJ1z+typsSwGkfvTx2h2Uqg8XM1xNMPlragcAadK x7sQYBrp8hk76CRYpdlrHQ3TIUrbErvn+2bi3KnDl8doJ36Y7snLtlM6QYg9vBnDXj9e7ykiqgMRZ GxZHtVYtzXdgP61irBb4XRvf/IXmwgy3PdxQ2JYVj2stEbnDEmsgYTIy/aJiwQhQU5RlC4ep1qRWC ckHyv1amluJGsQ98UNN9AOdL+iC8Maaj1h+gUvYPAG+bxMNAWBI7UCMdzPbjrtmwaueCq9Dt6Ve4w YDlQ7ivlZSiDoUCKitKTM0PwM1xgREg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e5fYZ-0003j1-DM; Fri, 20 Oct 2017 22:14:19 +0000 Received: from wsip-98-189-142-135.oc.oc.cox.net ([98.189.142.135] helo=office-server2) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e5fYP-0003c6-72 for linux-arm-kernel@lists.infradead.org; Fri, 20 Oct 2017 22:14:10 +0000 Received: from tkisky by office-server2 with local (Exim 4.88) (envelope-from ) id 1e5fXx-0003uD-Vd; Fri, 20 Oct 2017 15:13:42 -0700 From: Troy Kisky To: gregkh@linuxfoundation.org, nandor.han@ge.com Subject: [PATCH 1/1] tty: serial: imx: allow breaks to be received when using dma Date: Fri, 20 Oct 2017 15:13:40 -0700 Message-Id: <20171020221340.14974-1-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171020_151409_290546_E7633D6F X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Troy Kisky , linux-serial@vger.kernel.org, u.kleine-koenig@pengutronix.de, fabio.estevam@nxp.com, linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This allows me to login after sending a break when service serial-getty@ttymxc0.service is running Signed-off-by: Troy Kisky --- drivers/tty/serial/imx.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 506fcd742b47..39033f460a24 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -934,7 +934,6 @@ static void dma_rx_callback(void *data) status = dmaengine_tx_status(chan, (dma_cookie_t)0, &state); if (status == DMA_ERROR) { - dev_err(sport->port.dev, "DMA transaction error.\n"); clear_rx_errors(sport); return; } @@ -1035,6 +1034,7 @@ static int start_rx_dma(struct imx_port *sport) static void clear_rx_errors(struct imx_port *sport) { + struct tty_port *port = &sport->port.state->port; unsigned int status_usr1, status_usr2; status_usr1 = readl(sport->port.membase + USR1); @@ -1043,12 +1043,18 @@ static void clear_rx_errors(struct imx_port *sport) if (status_usr2 & USR2_BRCD) { sport->port.icount.brk++; writel(USR2_BRCD, sport->port.membase + USR2); - } else if (status_usr1 & USR1_FRAMERR) { - sport->port.icount.frame++; - writel(USR1_FRAMERR, sport->port.membase + USR1); - } else if (status_usr1 & USR1_PARITYERR) { - sport->port.icount.parity++; - writel(USR1_PARITYERR, sport->port.membase + USR1); + if (tty_insert_flip_char(port, 0, TTY_BREAK) == 0) + sport->port.icount.buf_overrun++; + tty_flip_buffer_push(port); + } else { + dev_err(sport->port.dev, "DMA transaction error.\n"); + if (status_usr1 & USR1_FRAMERR) { + sport->port.icount.frame++; + writel(USR1_FRAMERR, sport->port.membase + USR1); + } else if (status_usr1 & USR1_PARITYERR) { + sport->port.icount.parity++; + writel(USR1_PARITYERR, sport->port.membase + USR1); + } } if (status_usr2 & USR2_ORE) {