Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752950AbbFTRZw (ORCPT ); Sat, 20 Jun 2015 13:25:52 -0400 Received: from mout.gmx.net ([212.227.17.20]:59425 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755402AbbFTRZk (ORCPT ); Sat, 20 Jun 2015 13:25:40 -0400 Message-ID: <5585A20F.6040609@gmx.at> Date: Sat, 20 Jun 2015 19:25:35 +0200 From: Manfred Schlaegl User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Greg Kroah-Hartman CC: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Manfred Schlaegl Subject: [PATCH] serial: imx: count tty buffer overruns Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:K6P9ZcP7P7xtCXWhMuOuBuw+REmu/Cj8A3Dy0tYf1oPcxAqJXd1 oBdH845y09yx7CBkMPq1zaXyxAFxsuO3UH1GjucFSPLyLJ7IHW6sL8Md43RaJDVUa3LxfHe 5jKb4U2XQnK08J57H8MTczp1F9D9o9SRXLtMT7POps0/NQwmRgIjVLXXoRkoK8l1zF8PPiU uz9R76HS5wWhsGtkJYAGA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1478 Lines: 47 As can be seen in function uart_insert_char (serial_core) the element buf_overrun of struct uart_icount is used to count overruns of tty-buffer. Added support for counting of overruns in imx driver analogue to serial_core. Signed-off-by: Manfred Schlaegl --- drivers/tty/serial/imx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 8825039..384cf1d 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -700,7 +700,8 @@ static irqreturn_t imx_rxint(int irq, void *dev_id) if (sport->port.ignore_status_mask & URXD_DUMMY_READ) goto out; - tty_insert_flip_char(port, rx, flg); + if (tty_insert_flip_char(port, rx, flg) == 0) + sport->port.icount.buf_overrun++; } out: @@ -922,8 +923,13 @@ static void dma_rx_callback(void *data) dev_dbg(sport->port.dev, "We get %d bytes.\n", count); if (count) { - if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) - tty_insert_flip_string(port, sport->rx_buf, count); + if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) { + int bytes = tty_insert_flip_string(port, sport->rx_buf, + count); + + if (bytes != count) + sport->port.icount.buf_overrun++; + } tty_flip_buffer_push(port); start_rx_dma(sport); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/