mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
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@ni.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b1d679afd7
commit
642180871b
1 changed files with 4 additions and 2 deletions
|
@ -2526,14 +2526,16 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
|
|||
struct tty_struct *tty = port->state->port.tty;
|
||||
|
||||
if ((status & port->ignore_status_mask & ~overrun) == 0)
|
||||
tty_insert_flip_char(tty, ch, flag);
|
||||
if (tty_insert_flip_char(tty, ch, flag) == 0)
|
||||
++port->icount.buf_overrun;
|
||||
|
||||
/*
|
||||
* Overrun is special. Since it's reported immediately,
|
||||
* it doesn't affect the current character.
|
||||
*/
|
||||
if (status & ~port->ignore_status_mask & overrun)
|
||||
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
|
||||
if (tty_insert_flip_char(tty, 0, TTY_OVERRUN) == 0)
|
||||
++port->icount.buf_overrun;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(uart_insert_char);
|
||||
|
||||
|
|
Loading…
Reference in a new issue