From 4334e587722ac8a6c9c49f72d307f514db5e2f81 Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Tue, 6 Jun 2017 18:44:16 +0800 Subject: MLK-15031-07 tty: serial: fsl_lpuart: add port.icount for DMA rx path Add port.icount to stat. the DMA RX received count. Signed-off-by: Fugang Duan Reviewed-by: Robin Gong (cherry picked from commit: 9580def59011d50312cd722eddaf681388064230) --- drivers/tty/serial/fsl_lpuart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 0099b728e4de..b1357ac800a8 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -804,10 +804,9 @@ static void lpuart_copy_rx_to_tty(struct lpuart_port *sport, copied = tty_insert_flip_string(tty, ((unsigned char *)(sport->dma_rx_buf_virt)), count); - if (copied != count) { - WARN_ON(1); - dev_err(sport->port.dev, "RxData copy to tty layer failed\n"); - } + if (copied != count) + sport->port.icount.buf_overrun += count - copied; + sport->port.icount.rx += copied; } static void lpuart_dma_stop(struct lpuart_port *sport) -- cgit v1.2.3