Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932311AbbFTQlg (ORCPT ); Sat, 20 Jun 2015 12:41:36 -0400 Received: from mout.gmx.net ([212.227.17.22]:54895 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750833AbbFTQl2 (ORCPT ); Sat, 20 Jun 2015 12:41:28 -0400 Message-ID: <558597B0.80104@gmx.at> Date: Sat, 20 Jun 2015 18:41:20 +0200 From: "manfred.schlaegl@gmx.at" User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/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:daMZyNpqROujY43thw5q/qTJ8QEvqphOqBFieNgo+NK+1EjYJnx HCVlQz4Z84A7IZCiL+RbevoLWdDcXvOY4mL5fmIJb5MCJp5Ps/YMUcUTJfOG0iNvAZyaZQu JPLFQcp7Um/uzpAj2ULolLr1Xj5kqs1EZjlagA2AVDG/LG2ROEc5KMEcHCdg4BJVqFfs057 e6MZTN9lD8WB9AzvP7W2w== X-UI-Out-Filterresults: notjunk:1;V01:K0:34BGzhWzRig=:wX7bEfUS1VZAoxYE4yYo+W Q3BTONrcqAsnDONg8zwxp2tZ9dGZ+eTc7sgYSTvP6i5Y6Px7/FWo/s35CBuUrTFCpSqe6GkR0 E+MTu+dL09uXpu0eRNPQFR/JVlpVoyGgO0veogRzkydUzmt4QZNLzmxBH6av7IrG4v9Nogn40 RMD6cU16TpOkOEWXzfpHMHNhm1NEyabldPkv5P1X8fF6mOQ4FTcTR/2FsCaXPu7+jKQ57t/z8 kr7rGoXN5rJjg64VqkTlHBD6POGGPxCfUedAob2Y78lDF4KtzTlGOIUKRpJCX9y5f3XTgk/dO mz+EnJBgUV0BX51Ao9NCOq+I0/OpkgpD9YPO9c6evzGl/nU+k9t+rphXiXf/ytiA4y4Daxk8x oRbwO1EazAhG3G9atu5IuZQ9+XDehtR81hc0Y4pDJ7WDFs8DsjE/IU6pQ4VKbjyMBrbx6TiI1 kWFnKXY+zc/uPnLhtOYxlsWGKD3aBeKKZgjW2vm1pPSVFbimOr7d843mjrXD+onO1YQ7Abi/d jT4vUyWVQgFgU3etmhLm9X3R0AeV2pOej9xDuU97VUpRzElYDyJMTuSe2StqlTIVF6QAytAit efCeYoe5E1ywnUM5/6sMn2Jp111WMVhY41GuOIP4DJZYTgm3A5QI2c4YhpatPZlpkciUSpdM4 rLBrcRwhkmweMzpx1cCYKSIA0Q7SymIgKBMVF5uRUfESqdcui8X5xs2NqxCtCwbMquos= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2367 Lines: 63 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJVhZevAAoJEGS1eKPM78WhYlIP/1xUn8g37afejHntKdRgYOGZ V5izKDvCWNNxIIWQ3Rw1NtN9+695LO4WsZX7n4FYzBQbZHE8F5bzVM9bGnSJOjie 4imHKaGrzWhHy9uP/Z6j6aGqdqGHD6QtxcJ6A0u4A8CrYbUZKjEXk0YUH8BPawb4 8oKwm8Gn4N+ispHL9SDtV+q4yoOZApd6OcXdIpxrtKSunHWuSigJ66Fs7416liuh D90q4zEENvfdMqpBf5w5IxYUkhQHDCzE3NAgVUCeOqnFa84daq+H51GPEsbFdGlo MsFsu/qU0lQ1S+EnkbSoFQ/519ujMhi0pdxvcgHlijEFtLUmibh1jvIYdsw9et0o v3Xp5xGro7r9GOUhjiiTazVR0jPCt+owjAc/7PPiiBqaToeSeiSa7sJk8FBSkMPF sr2/4UStomLVZgnm/KY2O+HTTyw2insH7iVxJeHf7ZBEeQeRL+jgn2cgeyE8e8Vt x8jYXPhwYnWWh4C6wC1lidlCLfgDZGQI6DnnyTb2W7DEHNwGXJHPTA3N/liz5Kox LxNA5KA/l0gzsRZdv9iCuJVlxAWHBH5/wRE4+ojurNcyI5gGcOaiLzGqYc5QL7gz 1ODtX0RoP1guMkq6w1LSBSIWVIGXoFn8AcWkdDgpqBp0jXWo5s2ivGXaa3OKX80y NMGTG7+2PxXQ9aPtk3gv =BuFt -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/