aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/mxs-auart.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-06-16 08:10:41 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-19 16:04:52 -0400
commitef8b9ddcb45fa3b1e11acd72be2398001e807d14 (patch)
treebc3e882cdbdb0e34d1506534596be4af49e17d61 /drivers/tty/serial/mxs-auart.c
parenta859c8b2c309d91ba19d7bc273b41cb79b3ad17f (diff)
serial: Fix IGNBRK handling
If IGNBRK is set without either BRKINT or PARMRK set, some uart drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the line discipline, when it should send either nothing or the TTYBREAK flag set. This happens because the read_status_mask masks out the BI condition, which uart_insert_char() then interprets as a normal 0x00 byte. SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General Terminal Interface - Input Modes, states: "If IGNBRK is set, a break condition detected on input shall be ignored; that is, not put on the input queue and therefore not read by any process." Fix read_status_mask to include the BI bit if IGNBRK is set; the lsr status retains the BI bit if a BREAK is recv'd, which is subsequently ignored in uart_insert_char() when masked with the ignore_status_mask. Affected drivers: 8250 - all serial_txx9 mfd amba-pl010 amba-pl011 atmel_serial bfin_uart dz ip22zilog max310x mxs-auart netx-serial pnx8xxx_uart pxa sb1250-duart sccnxp serial_ks8695 sirfsoc_uart st-asc vr41xx_siu zs sunzilog fsl_lpuart sunsab ucc_uart bcm63xx_uart sunsu efm32-uart pmac_zilog mpsc msm_serial m32r_sio Unaffected drivers: omap-serial rp2 sa1100 imx icom Annotated for fixes: altera_uart mcf Drivers without break detection: 21285 xilinx-uartps altera_jtaguart apbuart arc-uart clps711x max3100 uartlite msm_serial_hs nwpserial lantiq vt8500_serial Unknown: samsung mpc52xx_uart bfin_sport_uart cpm_uart/core Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag' Reported-by: Ivan <athlon_@mail.ru> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/mxs-auart.c')
-rw-r--r--drivers/tty/serial/mxs-auart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 4b5b3c2fe328..86de4477d98a 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -604,7 +604,7 @@ static void mxs_auart_settermios(struct uart_port *u,
604 604
605 if (termios->c_iflag & INPCK) 605 if (termios->c_iflag & INPCK)
606 u->read_status_mask |= AUART_STAT_PERR; 606 u->read_status_mask |= AUART_STAT_PERR;
607 if (termios->c_iflag & (BRKINT | PARMRK)) 607 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
608 u->read_status_mask |= AUART_STAT_BERR; 608 u->read_status_mask |= AUART_STAT_BERR;
609 609
610 /* 610 /*