From patchwork Tue Feb 20 18:20:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 10230689 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 328C2601E7 for ; Tue, 20 Feb 2018 18:22:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 238E620163 for ; Tue, 20 Feb 2018 18:22:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1645A20223; Tue, 20 Feb 2018 18:22:29 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 B58B221BED for ; Tue, 20 Feb 2018 18:22:27 +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:References: In-Reply-To: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:List-Owner; bh=qJbqPIaTuGYPikxG+NXAja8mok9/CkkWgeXaPZiaz6k=; b=C60eaTG1KWZ0nFZeD+YHMuyCm7 ibYaZMVaVIdZG/9zfkUJy5EZoJXXBwD/bjOO50PzaVD3KX0LwDTD1A2DczmTiGhGRWqcQFyLA+/2D +nFi+8U9EqtJTFzn+ZtLdI/MTGAj8fDhbKdsrqwQSHuYYQaG1vpHl/YyeSKhkQ/mhX6WtNgoRqc0k hNlxhJ+VunW6xUL/pn1C16BsZ5Mx1TvtcLeHzSBI2RSn6obwY7MKoh7/YF8dgxp4us5jFIlyMt8op ytoZaRuUuW6lzCKQdGp6dyHYycxdbrHRR0w7QdCC/TomoIspwPFRcGYBFV813lK3c8NFFJcS/fSHK Ndji22jA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eoCYN-0004LI-8B; Tue, 20 Feb 2018 18:22:11 +0000 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eoCXt-00044r-9k for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2018 18:21:42 +0000 Received: by mail-oi0-x243.google.com with SMTP id y4so9996785oix.2 for ; Tue, 20 Feb 2018 10:21:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=F4Aek6BzH1AOCezfoBPsPbu9q5rQeM69ya8Oj+VVe0s=; b=z0UXvVI8CB1rPnoaF4DXlZ+be4gGQoXoVJNMOOyhJVoyKmy4LAkV+A0a5amqsNgMFY b60dLIXng1xtPFgUHb5/Si3SzA3eZKhnHJrHPArosloJ4IK8/lKsMPZki9kH4yu7y7J7 r+P+ryGn4QEgMIOzqFwlarKLxyOOtcN9sUb6ezo/CoQHilSNq1JkbEbYxHQkAo9QJ4tZ qyfaCfaZXjLw3clVu7SMFP/RIbiWx8wqd23c9cIn7FnC6zaAnW2RW2+zYP5gpMV1/d3S NxgM2SwCA75ffVWsvMqfSDZ+nS5RoTxQkFrl4m5Xwc0me+rzSwZgToUTAQT0VRd9ygTZ oTpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=F4Aek6BzH1AOCezfoBPsPbu9q5rQeM69ya8Oj+VVe0s=; b=SsakOVo6lVbzTr+Xf8o+fQ4RrM1KdyXaFYQxNZpTSps2W/nKMvod7+dkpWX/bftSZW tc76GETgpgEv3dHgWCq987HxGMocCDDhOdIqZaz58y2br//bRDxRJOoHMm6WGrP1GAQL LZk+svNOVD+MSSSYwwJw85kSbFlDu3zkl+9dM2Gzvf3F7qDcE8SZN1WwAzrlXf6S6FX7 yV5EkfAIT/Dp11KsqSJHycdeUc47EXlm1kY8grk3oDUDoFL8nmfkY22ejKJ/uJg3gmc8 YJ26/8x8/neIw697kl5GOKF+egq3gE4PKbCgqDnahcfON4TmWXHPBrQBAiBm/WTBA6Dd RzXw== X-Gm-Message-State: APf1xPB0R0y6vRWljfOZl/4P1OWymYNJwhj1QOXmz408cKdEa/HEj8nx IVBfenDDF0ovCqpBXiB3ZBug9g== X-Google-Smtp-Source: AH8x227WcVulymurod1Ot0da6ZdrXwX0Bzg3WeDMezPCnf8G50GOgPncVAvs1DWosGQJdX9CaiLyFA== X-Received: by 10.202.6.3 with SMTP id 3mr401926oig.260.1519150890337; Tue, 20 Feb 2018 10:21:30 -0800 (PST) Received: from localhost.localdomain (wsip-98-189-142-135.oc.oc.cox.net. [98.189.142.135]) by smtp.googlemail.com with ESMTPSA id h188sm5875397oib.4.2018.02.20.10.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 10:21:29 -0800 (PST) From: Troy Kisky To: gregkh@linuxfoundation.org Subject: [PATCH v3 1/1] tty: serial: imx: allow breaks to be received when using dma Date: Tue, 20 Feb 2018 10:20:38 -0800 Message-Id: <20180220182038.4325-2-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180220182038.4325-1-troy.kisky@boundarydevices.com> References: <20180220182038.4325-1-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180220_102141_342543_B0F56A06 X-CRM114-Status: GOOD ( 13.13 ) 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: mort@bork.org, 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 The "tty_insert_flip_char(port, 0, TTY_BREAK)" in clear_rx_errors fixes this by allowing the higher layers to see a break. Signed-off-by: Troy Kisky Tested-by: Martin Hicks --- v2: rebase only v3: change commit message as requested by Fabio, add tested-by --- 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 1d7ca382bc12..2eb8c4a20d68 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -927,7 +927,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; } @@ -1028,6 +1027,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); @@ -1036,12 +1036,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) {