summaryrefslogtreecommitdiffstats
path: root/drivers/tty/mxser.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2021-11-18 08:31:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-25 18:33:22 +0100
commiteb68ac0462bffc2ceb63b3a76737d6c9f186e6de (patch)
treee617360a78fb5160e21472a28a84923f14c94fc5 /drivers/tty/mxser.c
parent9dd6f3063a733e0df2ff66f9c35419eb217d9af5 (diff)
downloadlinux-eb68ac0462bffc2ceb63b3a76737d6c9f186e6de.tar.bz2
mxser: increase buf_overrun if tty_insert_flip_char() fails
mxser doesn't increase port->icount.buf_overrun at all. Do so if overrun happens, so that it can be read from the stats. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20211118073125.12283-17-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/mxser.c')
-rw-r--r--drivers/tty/mxser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 10862d4bb885..65ea4baee5eb 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -1507,7 +1507,8 @@ static bool mxser_receive_chars_new(struct mxser_port *port, u8 status)
while (gdl--) {
u8 ch = inb(port->ioaddr + UART_RX);
- tty_insert_flip_char(&port->port, ch, 0);
+ if (!tty_insert_flip_char(&port->port, ch, 0))
+ port->icount.buf_overrun++;
}
return true;
@@ -1553,8 +1554,10 @@ static u8 mxser_receive_chars_old(struct tty_struct *tty,
port->icount.overrun++;
}
}
- if (!tty_insert_flip_char(&port->port, ch, flag))
+ if (!tty_insert_flip_char(&port->port, ch, flag)) {
+ port->icount.buf_overrun++;
break;
+ }
}
if (hwid)