From patchwork Fri Feb 9 21:22:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 10210011 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 5A016602D8 for ; Fri, 9 Feb 2018 21:23:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B1AB296FC for ; Fri, 9 Feb 2018 21:23:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F5AE29704; Fri, 9 Feb 2018 21:23:04 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 7B606296FC for ; Fri, 9 Feb 2018 21:23:03 +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=NMxfXJYpyuXtvm+JtzpfSlFGJ5BBFbKizWU6/J56/fs=; b=Lpf CgYfrC3u355QoueqoJCb3/I3tWM6JxCDmSOrbUQ9Sv+KJf9GuGl+nGGNrMl0/67rKMi3zi6V7pRnv WRr0oA1Yzx2Fut1jnd1m7BddPQfB0zoQXGKpvh5tO08KiQNqHEJtnUiAwnCGN6zWz1/V1k8VDejj8 R0zTKf3an9kX/LkVaJi9s9yufN9FMsIiXO3lcN/tjePXAgR6KjGD+mgrCMJPW8+6i8YGObuDdL/WC 1q8e7hA6l7/eApJBgBenlLM27Wpab05TK7vDqQfDd+MghSAxiw8X8rEAnqfd33VrUlq3hTz+vuDQK yb8iBDaoetwdSjakvMrduej8cy8hagw==; 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 1ekG8M-00068G-Fv; Fri, 09 Feb 2018 21:23:02 +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 1ekG8K-00067O-3o for linux-arm-kernel@lists.infradead.org; Fri, 09 Feb 2018 21:23:01 +0000 Received: by mail-oi0-x243.google.com with SMTP id j188so7109547oib.6 for ; Fri, 09 Feb 2018 13:22:48 -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; bh=Z6TBz0tGuZDZSYyhg35eD4XPJ+1vesm71KMfmQQ/fqw=; b=SudtVeI66CGFtqtHGtAKz2M2gvPCXvkPGx/QK/aPUkfYBE3ucPfhfwdPeUnNiM5aqI /8mTEkfn1nFASblvryIjPRIgnVyo0AGTezDTG8AOHhRwhryVf1X0Ilzi10YHoMc4gtVF eZp8lAV0k4+FpNK5O2fb6Z89gqUZNBKaixkVYTmmaQXyOXpMz7es/V06zB1iq32zPWb9 t6zoHzyrp+cY44tnFbaUZRlV6fMOxuf5qTaKgN7VR3FojSwqgwZFKP8Zljh9BsWy2JJM PfRezj0EN9Mr8ZiYVCHBaK6yVJCg7nWuues0IQMlukGRdIIq1Ryb7FYk6ny5/Jj8poeu e2hw== 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; bh=Z6TBz0tGuZDZSYyhg35eD4XPJ+1vesm71KMfmQQ/fqw=; b=oxQneFsq6Vp/Ps9kX13eN4l5mwKE6LtEzsJM8T42gl4Ws8pVVZEBcvjrdilPfQjtQb pgbP+l57HVNFxIBpeg+6HHl+zkjDdRn2zoOqI0GobsweOTnTZtMRn7b2+3LTPEvn4mzR SsvfG+0qxgJ2ZEg2zXKFicUGHikTucrJzDpzTcYxfayfDBGW3CXuiiL4Uk9TRRTytHVq LTbODlJyGsDhaBpsG1baRD1yRQ21COZEywhWDABlkh5Ze/LAbae2NA6Yi/XK4z34GsJZ lwx1Tr7XaZhp93m1mQ3cEGMOrZeaTu7FhzrF8ZiV9n6/IU4I8F5aFSimUShrgXed47cb LH8Q== X-Gm-Message-State: APf1xPB9w4e7qiizSQBr44y6uAs9u6eGtVUTD4v0PUVnbIHwKyLnBTNI 166ubgsAk1KEOCNiNEbiuBu2aQ== X-Google-Smtp-Source: AH8x226bh/6lVcsvCC0Op3h5skeGzcXAkHasqbxNP8Cpd/MGW8HQEPg5hVciVbQAZl4zxPQLFBtIlA== X-Received: by 10.202.93.9 with SMTP id r9mr2817219oib.105.1518211368336; Fri, 09 Feb 2018 13:22:48 -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 i11sm1770444oth.5.2018.02.09.13.22.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 13:22:47 -0800 (PST) From: Troy Kisky To: gregkh@linuxfoundation.org Subject: [PATCH V2] tty: serial: imx: allow breaks to be received when using dma Date: Fri, 9 Feb 2018 13:22:40 -0800 Message-Id: <20180209212240.14095-1-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.14.1 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 Signed-off-by: Troy Kisky Tested-by: Martin Hicks --- v2: rebase only 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) {