aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/serial_core.c
diff options
context:
space:
mode:
authorCorbin <corbinat@gmail.com>2012-05-23 10:37:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-26 16:37:02 -0400
commit24a7d449b066bdba8b8b2486dc481f02043e0656 (patch)
treeb7713aeb9e733559b4349f2cbad259fbdd4b9407 /drivers/tty/serial/serial_core.c
parent10e7d0980fd40cbbdaa57349dfbabf78f7e1b5d5 (diff)
serial_core: Update buffer overrun statistics.
Currently, serial drivers don't report buffer overruns. When a buffer overrun occurs, tty_insert_flip_char returns 0, and no attempt is made to insert that same character again (i.e. it is lost). This patch reports buffer overruns via the buf_overrun field in the port's icount structure. Signed-off-by: Corbin Atkinson <corbin.atkinson@xxxxxx> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/serial_core.c')
-rw-r--r--drivers/tty/serial/serial_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 246b823c1b27..a21dc8e3b7c0 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2527,14 +2527,16 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
2527 struct tty_struct *tty = port->state->port.tty; 2527 struct tty_struct *tty = port->state->port.tty;
2528 2528
2529 if ((status & port->ignore_status_mask & ~overrun) == 0) 2529 if ((status & port->ignore_status_mask & ~overrun) == 0)
2530 tty_insert_flip_char(tty, ch, flag); 2530 if (tty_insert_flip_char(tty, ch, flag) == 0)
2531 ++port->icount.buf_overrun;
2531 2532
2532 /* 2533 /*
2533 * Overrun is special. Since it's reported immediately, 2534 * Overrun is special. Since it's reported immediately,
2534 * it doesn't affect the current character. 2535 * it doesn't affect the current character.
2535 */ 2536 */
2536 if (status & ~port->ignore_status_mask & overrun) 2537 if (status & ~port->ignore_status_mask & overrun)
2537 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 2538 if (tty_insert_flip_char(tty, 0, TTY_OVERRUN) == 0)
2539 ++port->icount.buf_overrun;
2538} 2540}
2539EXPORT_SYMBOL_GPL(uart_insert_char); 2541EXPORT_SYMBOL_GPL(uart_insert_char);
2540 2542