linux_dsm_epyc7002/drivers/tty/serial/8250
Peter Hurley ef8b9ddcb4 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>
2014-06-19 13:04:52 -07:00
..
8250_accent.c
8250_acorn.c tty: remove use of __devexit 2012-11-21 15:27:46 -08:00
8250_boca.c
8250_core.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
8250_dma.c serial: 8250_dma: check the result of TX buffer mapping 2014-05-28 13:07:27 -07:00
8250_dw.c 8250_dw: Support all baudrates on baytrail 2014-04-24 16:13:01 -07:00
8250_early.c tty/serial: add back missing setup_early_serial8250_console 2014-05-03 18:16:38 -04:00
8250_em.c tty: delete non-required instances of include <linux/init.h> 2014-01-07 17:05:21 -08:00
8250_exar_st16c554.c
8250_fourport.c
8250_fsl.c
8250_gsc.c parisc: Fix interrupt routing for C8000 serial ports 2013-07-31 23:42:32 +02:00
8250_hp300.c tty: remove use of __devexit 2012-11-21 15:27:46 -08:00
8250_hub6.c
8250_pci.c serial: Add support for Advantech PCM-3614I/PCM-3618I serial expansion cards 2014-05-28 12:39:14 -07:00
8250_pnp.c tty: delete non-required instances of include <linux/init.h> 2014-01-07 17:05:21 -08:00
8250.h serial: 8250: remove a few lines of dead code 2013-03-25 16:36:48 -07:00
Kconfig tty/serial: convert 8250 to generic earlycon 2014-04-24 16:32:27 -07:00
Makefile TTY: 8250, revert module name change 2013-03-25 16:26:23 -07:00
serial_cs.c tty: delete non-required instances of include <linux/init.h> 2014-01-07 17:05:21 -08:00