aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
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
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')
-rw-r--r--drivers/tty/serial/8250/8250_core.c2
-rw-r--r--drivers/tty/serial/altera_uart.c6
-rw-r--r--drivers/tty/serial/amba-pl010.c2
-rw-r--r--drivers/tty/serial/amba-pl011.c2
-rw-r--r--drivers/tty/serial/atmel_serial.c2
-rw-r--r--drivers/tty/serial/bcm63xx_uart.c2
-rw-r--r--drivers/tty/serial/bfin_uart.c2
-rw-r--r--drivers/tty/serial/dz.c2
-rw-r--r--drivers/tty/serial/efm32-uart.c2
-rw-r--r--drivers/tty/serial/fsl_lpuart.c2
-rw-r--r--drivers/tty/serial/ip22zilog.c2
-rw-r--r--drivers/tty/serial/m32r_sio.c2
-rw-r--r--drivers/tty/serial/max310x.c2
-rw-r--r--drivers/tty/serial/mcf.c6
-rw-r--r--drivers/tty/serial/mfd.c2
-rw-r--r--drivers/tty/serial/mpsc.c2
-rw-r--r--drivers/tty/serial/msm_serial.c2
-rw-r--r--drivers/tty/serial/mxs-auart.c2
-rw-r--r--drivers/tty/serial/netx-serial.c2
-rw-r--r--drivers/tty/serial/pmac_zilog.c2
-rw-r--r--drivers/tty/serial/pnx8xxx_uart.c2
-rw-r--r--drivers/tty/serial/pxa.c2
-rw-r--r--drivers/tty/serial/sb1250-duart.c2
-rw-r--r--drivers/tty/serial/sccnxp.c2
-rw-r--r--drivers/tty/serial/serial_ks8695.c2
-rw-r--r--drivers/tty/serial/serial_txx9.c2
-rw-r--r--drivers/tty/serial/sirfsoc_uart.c2
-rw-r--r--drivers/tty/serial/st-asc.c2
-rw-r--r--drivers/tty/serial/sunsab.c2
-rw-r--r--drivers/tty/serial/sunsu.c2
-rw-r--r--drivers/tty/serial/sunzilog.c2
-rw-r--r--drivers/tty/serial/ucc_uart.c2
-rw-r--r--drivers/tty/serial/vr41xx_siu.c2
-rw-r--r--drivers/tty/serial/zs.c2
34 files changed, 44 insertions, 32 deletions
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 27f7ad6b74c1..7a91c6d1eb7d 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2357,7 +2357,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
2357 port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 2357 port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
2358 if (termios->c_iflag & INPCK) 2358 if (termios->c_iflag & INPCK)
2359 port->read_status_mask |= UART_LSR_FE | UART_LSR_PE; 2359 port->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
2360 if (termios->c_iflag & (BRKINT | PARMRK)) 2360 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
2361 port->read_status_mask |= UART_LSR_BI; 2361 port->read_status_mask |= UART_LSR_BI;
2362 2362
2363 /* 2363 /*
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index 501667e3e3f5..323376668b72 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -185,6 +185,12 @@ static void altera_uart_set_termios(struct uart_port *port,
185 uart_update_timeout(port, termios->c_cflag, baud); 185 uart_update_timeout(port, termios->c_cflag, baud);
186 altera_uart_writel(port, baudclk, ALTERA_UART_DIVISOR_REG); 186 altera_uart_writel(port, baudclk, ALTERA_UART_DIVISOR_REG);
187 spin_unlock_irqrestore(&port->lock, flags); 187 spin_unlock_irqrestore(&port->lock, flags);
188
189 /*
190 * FIXME: port->read_status_mask and port->ignore_status_mask
191 * need to be initialized based on termios settings for
192 * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT
193 */
188} 194}
189 195
190static void altera_uart_rx_chars(struct altera_uart *pp) 196static void altera_uart_rx_chars(struct altera_uart *pp)
diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index 01c9e72433e1..971af1e22d0f 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -420,7 +420,7 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios,
420 uap->port.read_status_mask = UART01x_RSR_OE; 420 uap->port.read_status_mask = UART01x_RSR_OE;
421 if (termios->c_iflag & INPCK) 421 if (termios->c_iflag & INPCK)
422 uap->port.read_status_mask |= UART01x_RSR_FE | UART01x_RSR_PE; 422 uap->port.read_status_mask |= UART01x_RSR_FE | UART01x_RSR_PE;
423 if (termios->c_iflag & (BRKINT | PARMRK)) 423 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
424 uap->port.read_status_mask |= UART01x_RSR_BE; 424 uap->port.read_status_mask |= UART01x_RSR_BE;
425 425
426 /* 426 /*
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 908a6e3142a2..0e26dcbd5ea4 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1744,7 +1744,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
1744 port->read_status_mask = UART011_DR_OE | 255; 1744 port->read_status_mask = UART011_DR_OE | 255;
1745 if (termios->c_iflag & INPCK) 1745 if (termios->c_iflag & INPCK)
1746 port->read_status_mask |= UART011_DR_FE | UART011_DR_PE; 1746 port->read_status_mask |= UART011_DR_FE | UART011_DR_PE;
1747 if (termios->c_iflag & (BRKINT | PARMRK)) 1747 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
1748 port->read_status_mask |= UART011_DR_BE; 1748 port->read_status_mask |= UART011_DR_BE;
1749 1749
1750 /* 1750 /*
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 3fceae099c44..c4f750314100 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1932,7 +1932,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
1932 port->read_status_mask = ATMEL_US_OVRE; 1932 port->read_status_mask = ATMEL_US_OVRE;
1933 if (termios->c_iflag & INPCK) 1933 if (termios->c_iflag & INPCK)
1934 port->read_status_mask |= (ATMEL_US_FRAME | ATMEL_US_PARE); 1934 port->read_status_mask |= (ATMEL_US_FRAME | ATMEL_US_PARE);
1935 if (termios->c_iflag & (BRKINT | PARMRK)) 1935 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
1936 port->read_status_mask |= ATMEL_US_RXBRK; 1936 port->read_status_mask |= ATMEL_US_RXBRK;
1937 1937
1938 if (atmel_use_pdc_rx(port)) 1938 if (atmel_use_pdc_rx(port))
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index a47421e4627c..231519022b73 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -567,7 +567,7 @@ static void bcm_uart_set_termios(struct uart_port *port,
567 port->read_status_mask |= UART_FIFO_FRAMEERR_MASK; 567 port->read_status_mask |= UART_FIFO_FRAMEERR_MASK;
568 port->read_status_mask |= UART_FIFO_PARERR_MASK; 568 port->read_status_mask |= UART_FIFO_PARERR_MASK;
569 } 569 }
570 if (new->c_iflag & (BRKINT)) 570 if (new->c_iflag & (IGNBRK | BRKINT))
571 port->read_status_mask |= UART_FIFO_BRKDET_MASK; 571 port->read_status_mask |= UART_FIFO_BRKDET_MASK;
572 572
573 port->ignore_status_mask = 0; 573 port->ignore_status_mask = 0;
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index 869ceba2ec57..ac86a20992e9 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -833,7 +833,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
833 port->read_status_mask = OE; 833 port->read_status_mask = OE;
834 if (termios->c_iflag & INPCK) 834 if (termios->c_iflag & INPCK)
835 port->read_status_mask |= (FE | PE); 835 port->read_status_mask |= (FE | PE);
836 if (termios->c_iflag & (BRKINT | PARMRK)) 836 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
837 port->read_status_mask |= BI; 837 port->read_status_mask |= BI;
838 838
839 /* 839 /*
diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c
index 2f2b2e538a54..cdbbc788230a 100644
--- a/drivers/tty/serial/dz.c
+++ b/drivers/tty/serial/dz.c
@@ -625,7 +625,7 @@ static void dz_set_termios(struct uart_port *uport, struct ktermios *termios,
625 dport->port.read_status_mask = DZ_OERR; 625 dport->port.read_status_mask = DZ_OERR;
626 if (termios->c_iflag & INPCK) 626 if (termios->c_iflag & INPCK)
627 dport->port.read_status_mask |= DZ_FERR | DZ_PERR; 627 dport->port.read_status_mask |= DZ_FERR | DZ_PERR;
628 if (termios->c_iflag & (BRKINT | PARMRK)) 628 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
629 dport->port.read_status_mask |= DZ_BREAK; 629 dport->port.read_status_mask |= DZ_BREAK;
630 630
631 /* characters to ignore */ 631 /* characters to ignore */
diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c
index b373f6416e8c..3b0ee9afd76f 100644
--- a/drivers/tty/serial/efm32-uart.c
+++ b/drivers/tty/serial/efm32-uart.c
@@ -407,7 +407,7 @@ static void efm32_uart_set_termios(struct uart_port *port,
407 if (new->c_iflag & INPCK) 407 if (new->c_iflag & INPCK)
408 port->read_status_mask |= 408 port->read_status_mask |=
409 UARTn_RXDATAX_FERR | UARTn_RXDATAX_PERR; 409 UARTn_RXDATAX_FERR | UARTn_RXDATAX_PERR;
410 if (new->c_iflag & (BRKINT | PARMRK)) 410 if (new->c_iflag & (IGNBRK | BRKINT | PARMRK))
411 port->read_status_mask |= SW_UARTn_RXDATAX_BERR; 411 port->read_status_mask |= SW_UARTn_RXDATAX_BERR;
412 412
413 port->ignore_status_mask = 0; 413 port->ignore_status_mask = 0;
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index c5eb897de9de..49385c86cfba 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -902,7 +902,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios,
902 sport->port.read_status_mask = 0; 902 sport->port.read_status_mask = 0;
903 if (termios->c_iflag & INPCK) 903 if (termios->c_iflag & INPCK)
904 sport->port.read_status_mask |= (UARTSR1_FE | UARTSR1_PE); 904 sport->port.read_status_mask |= (UARTSR1_FE | UARTSR1_PE);
905 if (termios->c_iflag & (BRKINT | PARMRK)) 905 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
906 sport->port.read_status_mask |= UARTSR1_FE; 906 sport->port.read_status_mask |= UARTSR1_FE;
907 907
908 /* characters to ignore */ 908 /* characters to ignore */
diff --git a/drivers/tty/serial/ip22zilog.c b/drivers/tty/serial/ip22zilog.c
index 1d9420548e16..1efd4c36ba0c 100644
--- a/drivers/tty/serial/ip22zilog.c
+++ b/drivers/tty/serial/ip22zilog.c
@@ -850,7 +850,7 @@ ip22zilog_convert_to_zs(struct uart_ip22zilog_port *up, unsigned int cflag,
850 up->port.read_status_mask = Rx_OVR; 850 up->port.read_status_mask = Rx_OVR;
851 if (iflag & INPCK) 851 if (iflag & INPCK)
852 up->port.read_status_mask |= CRC_ERR | PAR_ERR; 852 up->port.read_status_mask |= CRC_ERR | PAR_ERR;
853 if (iflag & (BRKINT | PARMRK)) 853 if (iflag & (IGNBRK | BRKINT | PARMRK))
854 up->port.read_status_mask |= BRK_ABRT; 854 up->port.read_status_mask |= BRK_ABRT;
855 855
856 up->port.ignore_status_mask = 0; 856 up->port.ignore_status_mask = 0;
diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c
index 9cd9b4eba9fc..68f2c53e0b54 100644
--- a/drivers/tty/serial/m32r_sio.c
+++ b/drivers/tty/serial/m32r_sio.c
@@ -737,7 +737,7 @@ static void m32r_sio_set_termios(struct uart_port *port,
737 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 737 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
738 if (termios->c_iflag & INPCK) 738 if (termios->c_iflag & INPCK)
739 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; 739 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
740 if (termios->c_iflag & (BRKINT | PARMRK)) 740 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
741 up->port.read_status_mask |= UART_LSR_BI; 741 up->port.read_status_mask |= UART_LSR_BI;
742 742
743 /* 743 /*
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index 2a99d0c61b9e..ba285cd45b59 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -835,7 +835,7 @@ static void max310x_set_termios(struct uart_port *port,
835 if (termios->c_iflag & INPCK) 835 if (termios->c_iflag & INPCK)
836 port->read_status_mask |= MAX310X_LSR_RXPAR_BIT | 836 port->read_status_mask |= MAX310X_LSR_RXPAR_BIT |
837 MAX310X_LSR_FRERR_BIT; 837 MAX310X_LSR_FRERR_BIT;
838 if (termios->c_iflag & (BRKINT | PARMRK)) 838 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
839 port->read_status_mask |= MAX310X_LSR_RXBRK_BIT; 839 port->read_status_mask |= MAX310X_LSR_RXBRK_BIT;
840 840
841 /* Set status ignore mask */ 841 /* Set status ignore mask */
diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c
index 0edfaf8cd269..a6f085717f94 100644
--- a/drivers/tty/serial/mcf.c
+++ b/drivers/tty/serial/mcf.c
@@ -248,6 +248,12 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios,
248 mr1 |= MCFUART_MR1_PARITYNONE; 248 mr1 |= MCFUART_MR1_PARITYNONE;
249 } 249 }
250 250
251 /*
252 * FIXME: port->read_status_mask and port->ignore_status_mask
253 * need to be initialized based on termios settings for
254 * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT
255 */
256
251 if (termios->c_cflag & CSTOPB) 257 if (termios->c_cflag & CSTOPB)
252 mr2 |= MCFUART_MR2_STOP2; 258 mr2 |= MCFUART_MR2_STOP2;
253 else 259 else
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index 52c930fac210..445799dc9846 100644
--- a/drivers/tty/serial/mfd.c
+++ b/drivers/tty/serial/mfd.c
@@ -977,7 +977,7 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios,
977 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 977 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
978 if (termios->c_iflag & INPCK) 978 if (termios->c_iflag & INPCK)
979 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; 979 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
980 if (termios->c_iflag & (BRKINT | PARMRK)) 980 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
981 up->port.read_status_mask |= UART_LSR_BI; 981 up->port.read_status_mask |= UART_LSR_BI;
982 982
983 /* Characters to ignore */ 983 /* Characters to ignore */
diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c
index e30a3ca3cea3..759c6a6fa74a 100644
--- a/drivers/tty/serial/mpsc.c
+++ b/drivers/tty/serial/mpsc.c
@@ -1458,7 +1458,7 @@ static void mpsc_set_termios(struct uart_port *port, struct ktermios *termios,
1458 pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_PE 1458 pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_PE
1459 | SDMA_DESC_CMDSTAT_FR; 1459 | SDMA_DESC_CMDSTAT_FR;
1460 1460
1461 if (termios->c_iflag & (BRKINT | PARMRK)) 1461 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
1462 pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_BR; 1462 pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_BR;
1463 1463
1464 /* Characters/events to ignore */ 1464 /* Characters/events to ignore */
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index 778e376f197e..c41aca4dfc43 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -582,7 +582,7 @@ static void msm_set_termios(struct uart_port *port, struct ktermios *termios,
582 port->read_status_mask = 0; 582 port->read_status_mask = 0;
583 if (termios->c_iflag & INPCK) 583 if (termios->c_iflag & INPCK)
584 port->read_status_mask |= UART_SR_PAR_FRAME_ERR; 584 port->read_status_mask |= UART_SR_PAR_FRAME_ERR;
585 if (termios->c_iflag & (BRKINT | PARMRK)) 585 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
586 port->read_status_mask |= UART_SR_RX_BREAK; 586 port->read_status_mask |= UART_SR_RX_BREAK;
587 587
588 uart_update_timeout(port, termios->c_cflag, baud); 588 uart_update_timeout(port, termios->c_cflag, baud);
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 /*
diff --git a/drivers/tty/serial/netx-serial.c b/drivers/tty/serial/netx-serial.c
index 0a4dd70d29eb..7a6745601d4e 100644
--- a/drivers/tty/serial/netx-serial.c
+++ b/drivers/tty/serial/netx-serial.c
@@ -419,7 +419,7 @@ netx_set_termios(struct uart_port *port, struct ktermios *termios,
419 } 419 }
420 420
421 port->read_status_mask = 0; 421 port->read_status_mask = 0;
422 if (termios->c_iflag & (BRKINT | PARMRK)) 422 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
423 port->read_status_mask |= SR_BE; 423 port->read_status_mask |= SR_BE;
424 if (termios->c_iflag & INPCK) 424 if (termios->c_iflag & INPCK)
425 port->read_status_mask |= SR_PE | SR_FE; 425 port->read_status_mask |= SR_PE | SR_FE;
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index e9d420ff3931..8193635103ee 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -1092,7 +1092,7 @@ static void pmz_convert_to_zs(struct uart_pmac_port *uap, unsigned int cflag,
1092 uap->port.read_status_mask = Rx_OVR; 1092 uap->port.read_status_mask = Rx_OVR;
1093 if (iflag & INPCK) 1093 if (iflag & INPCK)
1094 uap->port.read_status_mask |= CRC_ERR | PAR_ERR; 1094 uap->port.read_status_mask |= CRC_ERR | PAR_ERR;
1095 if (iflag & (BRKINT | PARMRK)) 1095 if (iflag & (IGNBRK | BRKINT | PARMRK))
1096 uap->port.read_status_mask |= BRK_ABRT; 1096 uap->port.read_status_mask |= BRK_ABRT;
1097 1097
1098 uap->port.ignore_status_mask = 0; 1098 uap->port.ignore_status_mask = 0;
diff --git a/drivers/tty/serial/pnx8xxx_uart.c b/drivers/tty/serial/pnx8xxx_uart.c
index de6c05c63683..2ba24a45c97f 100644
--- a/drivers/tty/serial/pnx8xxx_uart.c
+++ b/drivers/tty/serial/pnx8xxx_uart.c
@@ -477,7 +477,7 @@ pnx8xxx_set_termios(struct uart_port *port, struct ktermios *termios,
477 sport->port.read_status_mask |= 477 sport->port.read_status_mask |=
478 FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) | 478 FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) |
479 FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR); 479 FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR);
480 if (termios->c_iflag & (BRKINT | PARMRK)) 480 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
481 sport->port.read_status_mask |= 481 sport->port.read_status_mask |=
482 ISTAT_TO_SM(PNX8XXX_UART_INT_BREAK); 482 ISTAT_TO_SM(PNX8XXX_UART_INT_BREAK);
483 483
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 9e7ee39f8b2a..c638c53cd2b6 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -492,7 +492,7 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios,
492 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 492 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
493 if (termios->c_iflag & INPCK) 493 if (termios->c_iflag & INPCK)
494 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; 494 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
495 if (termios->c_iflag & (BRKINT | PARMRK)) 495 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
496 up->port.read_status_mask |= UART_LSR_BI; 496 up->port.read_status_mask |= UART_LSR_BI;
497 497
498 /* 498 /*
diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c
index a7cdec2962dd..771f361c47ea 100644
--- a/drivers/tty/serial/sb1250-duart.c
+++ b/drivers/tty/serial/sb1250-duart.c
@@ -596,7 +596,7 @@ static void sbd_set_termios(struct uart_port *uport, struct ktermios *termios,
596 if (termios->c_iflag & INPCK) 596 if (termios->c_iflag & INPCK)
597 uport->read_status_mask |= M_DUART_FRM_ERR | 597 uport->read_status_mask |= M_DUART_FRM_ERR |
598 M_DUART_PARITY_ERR; 598 M_DUART_PARITY_ERR;
599 if (termios->c_iflag & (BRKINT | PARMRK)) 599 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
600 uport->read_status_mask |= M_DUART_RCVD_BRK; 600 uport->read_status_mask |= M_DUART_RCVD_BRK;
601 601
602 uport->ignore_status_mask = 0; 602 uport->ignore_status_mask = 0;
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 5443b46345ed..e84b6a3bdd18 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -665,7 +665,7 @@ static void sccnxp_set_termios(struct uart_port *port,
665 port->read_status_mask = SR_OVR; 665 port->read_status_mask = SR_OVR;
666 if (termios->c_iflag & INPCK) 666 if (termios->c_iflag & INPCK)
667 port->read_status_mask |= SR_PE | SR_FE; 667 port->read_status_mask |= SR_PE | SR_FE;
668 if (termios->c_iflag & (BRKINT | PARMRK)) 668 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
669 port->read_status_mask |= SR_BRK; 669 port->read_status_mask |= SR_BRK;
670 670
671 /* Set status ignore mask */ 671 /* Set status ignore mask */
diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c
index e1caa99e3d3b..5c79bdab985d 100644
--- a/drivers/tty/serial/serial_ks8695.c
+++ b/drivers/tty/serial/serial_ks8695.c
@@ -437,7 +437,7 @@ static void ks8695uart_set_termios(struct uart_port *port, struct ktermios *term
437 port->read_status_mask = URLS_URROE; 437 port->read_status_mask = URLS_URROE;
438 if (termios->c_iflag & INPCK) 438 if (termios->c_iflag & INPCK)
439 port->read_status_mask |= (URLS_URFE | URLS_URPE); 439 port->read_status_mask |= (URLS_URFE | URLS_URPE);
440 if (termios->c_iflag & (BRKINT | PARMRK)) 440 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
441 port->read_status_mask |= URLS_URBI; 441 port->read_status_mask |= URLS_URBI;
442 442
443 /* 443 /*
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c
index 60f49b9d7e39..ea8546092c7e 100644
--- a/drivers/tty/serial/serial_txx9.c
+++ b/drivers/tty/serial/serial_txx9.c
@@ -697,7 +697,7 @@ serial_txx9_set_termios(struct uart_port *port, struct ktermios *termios,
697 TXX9_SIDISR_TDIS | TXX9_SIDISR_RDIS; 697 TXX9_SIDISR_TDIS | TXX9_SIDISR_RDIS;
698 if (termios->c_iflag & INPCK) 698 if (termios->c_iflag & INPCK)
699 up->port.read_status_mask |= TXX9_SIDISR_UFER | TXX9_SIDISR_UPER; 699 up->port.read_status_mask |= TXX9_SIDISR_UFER | TXX9_SIDISR_UPER;
700 if (termios->c_iflag & (BRKINT | PARMRK)) 700 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
701 up->port.read_status_mask |= TXX9_SIDISR_UBRK; 701 up->port.read_status_mask |= TXX9_SIDISR_UBRK;
702 702
703 /* 703 /*
diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c
index 1f2be48c92ce..9b4d71cff00d 100644
--- a/drivers/tty/serial/sirfsoc_uart.c
+++ b/drivers/tty/serial/sirfsoc_uart.c
@@ -896,7 +896,7 @@ static void sirfsoc_uart_set_termios(struct uart_port *port,
896 if (termios->c_iflag & INPCK) 896 if (termios->c_iflag & INPCK)
897 port->read_status_mask |= uint_en->sirfsoc_frm_err_en; 897 port->read_status_mask |= uint_en->sirfsoc_frm_err_en;
898 } 898 }
899 if (termios->c_iflag & (BRKINT | PARMRK)) 899 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
900 port->read_status_mask |= uint_en->sirfsoc_rxd_brk_en; 900 port->read_status_mask |= uint_en->sirfsoc_rxd_brk_en;
901 if (sirfport->uart_reg->uart_type == SIRF_REAL_UART) { 901 if (sirfport->uart_reg->uart_type == SIRF_REAL_UART) {
902 if (termios->c_iflag & IGNPAR) 902 if (termios->c_iflag & IGNPAR)
diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index c7f61ac27132..f48b1cc07eea 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -547,7 +547,7 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios,
547 ascport->port.read_status_mask = ASC_RXBUF_DUMMY_OE; 547 ascport->port.read_status_mask = ASC_RXBUF_DUMMY_OE;
548 if (termios->c_iflag & INPCK) 548 if (termios->c_iflag & INPCK)
549 ascport->port.read_status_mask |= ASC_RXBUF_FE | ASC_RXBUF_PE; 549 ascport->port.read_status_mask |= ASC_RXBUF_FE | ASC_RXBUF_PE;
550 if (termios->c_iflag & (BRKINT | PARMRK)) 550 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
551 ascport->port.read_status_mask |= ASC_RXBUF_DUMMY_BE; 551 ascport->port.read_status_mask |= ASC_RXBUF_DUMMY_BE;
552 552
553 /* 553 /*
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c
index 5faa8e905e98..80a58eca785b 100644
--- a/drivers/tty/serial/sunsab.c
+++ b/drivers/tty/serial/sunsab.c
@@ -719,7 +719,7 @@ static void sunsab_convert_to_sab(struct uart_sunsab_port *up, unsigned int cfla
719 if (iflag & INPCK) 719 if (iflag & INPCK)
720 up->port.read_status_mask |= (SAB82532_ISR0_PERR | 720 up->port.read_status_mask |= (SAB82532_ISR0_PERR |
721 SAB82532_ISR0_FERR); 721 SAB82532_ISR0_FERR);
722 if (iflag & (BRKINT | PARMRK)) 722 if (iflag & (IGNBRK | BRKINT | PARMRK))
723 up->port.read_status_mask |= (SAB82532_ISR1_BRK << 8); 723 up->port.read_status_mask |= (SAB82532_ISR1_BRK << 8);
724 724
725 /* 725 /*
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 9a0f24f83720..5326ae195e5f 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -834,7 +834,7 @@ sunsu_change_speed(struct uart_port *port, unsigned int cflag,
834 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 834 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
835 if (iflag & INPCK) 835 if (iflag & INPCK)
836 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; 836 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
837 if (iflag & (BRKINT | PARMRK)) 837 if (iflag & (IGNBRK | BRKINT | PARMRK))
838 up->port.read_status_mask |= UART_LSR_BI; 838 up->port.read_status_mask |= UART_LSR_BI;
839 839
840 /* 840 /*
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index a2c40ed287d2..a85db8b87156 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -915,7 +915,7 @@ sunzilog_convert_to_zs(struct uart_sunzilog_port *up, unsigned int cflag,
915 up->port.read_status_mask = Rx_OVR; 915 up->port.read_status_mask = Rx_OVR;
916 if (iflag & INPCK) 916 if (iflag & INPCK)
917 up->port.read_status_mask |= CRC_ERR | PAR_ERR; 917 up->port.read_status_mask |= CRC_ERR | PAR_ERR;
918 if (iflag & (BRKINT | PARMRK)) 918 if (iflag & (IGNBRK | BRKINT | PARMRK))
919 up->port.read_status_mask |= BRK_ABRT; 919 up->port.read_status_mask |= BRK_ABRT;
920 920
921 up->port.ignore_status_mask = 0; 921 up->port.ignore_status_mask = 0;
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index d569ca58bab6..1c52074c38df 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -936,7 +936,7 @@ static void qe_uart_set_termios(struct uart_port *port,
936 port->read_status_mask = BD_SC_EMPTY | BD_SC_OV; 936 port->read_status_mask = BD_SC_EMPTY | BD_SC_OV;
937 if (termios->c_iflag & INPCK) 937 if (termios->c_iflag & INPCK)
938 port->read_status_mask |= BD_SC_FR | BD_SC_PR; 938 port->read_status_mask |= BD_SC_FR | BD_SC_PR;
939 if (termios->c_iflag & (BRKINT | PARMRK)) 939 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
940 port->read_status_mask |= BD_SC_BR; 940 port->read_status_mask |= BD_SC_BR;
941 941
942 /* 942 /*
diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c
index a63c14bc9a24..db0c8a4ab03e 100644
--- a/drivers/tty/serial/vr41xx_siu.c
+++ b/drivers/tty/serial/vr41xx_siu.c
@@ -559,7 +559,7 @@ static void siu_set_termios(struct uart_port *port, struct ktermios *new,
559 port->read_status_mask = UART_LSR_THRE | UART_LSR_OE | UART_LSR_DR; 559 port->read_status_mask = UART_LSR_THRE | UART_LSR_OE | UART_LSR_DR;
560 if (c_iflag & INPCK) 560 if (c_iflag & INPCK)
561 port->read_status_mask |= UART_LSR_FE | UART_LSR_PE; 561 port->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
562 if (c_iflag & (BRKINT | PARMRK)) 562 if (c_iflag & (IGNBRK | BRKINT | PARMRK))
563 port->read_status_mask |= UART_LSR_BI; 563 port->read_status_mask |= UART_LSR_BI;
564 564
565 port->ignore_status_mask = 0; 565 port->ignore_status_mask = 0;
diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c
index 6a169877109b..2b65bb7ffb8a 100644
--- a/drivers/tty/serial/zs.c
+++ b/drivers/tty/serial/zs.c
@@ -923,7 +923,7 @@ static void zs_set_termios(struct uart_port *uport, struct ktermios *termios,
923 uport->read_status_mask = Rx_OVR; 923 uport->read_status_mask = Rx_OVR;
924 if (termios->c_iflag & INPCK) 924 if (termios->c_iflag & INPCK)
925 uport->read_status_mask |= FRM_ERR | PAR_ERR; 925 uport->read_status_mask |= FRM_ERR | PAR_ERR;
926 if (termios->c_iflag & (BRKINT | PARMRK)) 926 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
927 uport->read_status_mask |= Rx_BRK; 927 uport->read_status_mask |= Rx_BRK;
928 928
929 uport->ignore_status_mask = 0; 929 uport->ignore_status_mask = 0;