linux/drivers/tty/serial
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 serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
cpm_uart serial: cpm_uart: No LF conversion in put_poll_char() 2014-05-29 11:28:05 -07:00
jsm
21285.c
68328serial.c
altera_jtaguart.c
altera_uart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
amba-pl010.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
amba-pl011.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
apbuart.c
apbuart.h
ar933x_uart.c
arc_uart.c
atmel_serial.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
bcm63xx_uart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
bfin_sport_uart.c
bfin_sport_uart.h
bfin_uart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
clps711x.c Revert "serial: clps711x: Give a chance to perform useful tasks during wait loop" 2014-04-16 14:17:44 -07:00
crisv10.c tty: serial: crisv10: Drop remaining code for CRISv10 CPU simulator 2014-02-15 12:16:21 -08:00
crisv10.h
dz.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
dz.h
earlycon-arm-semihost.c tty/serial: add arm/arm64 semihosting earlycon 2014-04-24 16:32:27 -07:00
earlycon.c serial: earlycon: add DT support 2014-05-20 15:19:25 -05:00
efm32-uart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
fsl_lpuart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
icom.c serial: icom: dereference after free in load_code() 2013-12-08 17:16:05 -08:00
icom.h
ifx6x60.c
ifx6x60.h
imx.c Revert "serial: imx: remove the DMA wait queue" 2014-05-29 19:30:54 -07:00
ioc3_serial.c
ioc4_serial.c
ip22zilog.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
ip22zilog.h
Kconfig tty/serial: at91: use mctrl_gpio helpers 2014-05-28 12:49:44 -07:00
kgdb_nmi.c serial: kgdb_nmi: Improve console integration with KDB I/O 2014-05-29 11:28:05 -07:00
kgdboc.c
lantiq.c
lpc32xx_hs.c
m32r_sio_reg.h
m32r_sio.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
m32r_sio.h
Makefile tty/serial: Add GPIOLIB helpers for controlling modem lines 2014-05-28 12:49:14 -07:00
max310x.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
max3100.c
mcf.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
men_z135_uart.c tty: serial: men_z135_uart: Don't activate TX Space available IRQ on startup 2014-05-28 12:27:22 -07:00
mfd.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
mpc52xx_uart.c serial: mpc512x: setup the PSC FIFO clock as well 2014-01-12 18:53:05 +01:00
mpsc.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
mrst_max3110.c
mrst_max3110.h
msm_serial_hs.c
msm_serial.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
msm_serial.h tty: serial: msm: Remove direct access to GSBI 2014-05-29 11:06:20 -05:00
msm_smd_tty.c
mux.c tty: serial: replace del_timer by del_timer_sync 2014-04-24 16:13:01 -07:00
mxs-auart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
netx-serial.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
nwpserial.c
of_serial.c printk/of_serial: fix serial console cessation part way through boot. 2014-05-28 13:07:27 -07:00
omap-serial.c tty: serial: omap: fix Sparse warnings 2014-04-24 16:19:02 -07:00
pch_uart.c serial_core: Commonalize crlf when working w/ a non open console port 2014-04-24 16:13:01 -07:00
pmac_zilog.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
pmac_zilog.h
pnx8xxx_uart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
pxa.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
rp2.c tty: remove DEFINE_PCI_DEVICE_TABLE macro 2013-12-08 17:09:07 -08:00
sa1100.c
samsung.c serial: samsung: Fix build error 2014-06-17 17:09:36 -07:00
samsung.h serial: samsung: Neaten dbg uses 2014-05-28 12:27:22 -07:00
sb1250-duart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
sc16is7xx.c serial: sc16is7xx: dynamically allocate tx/rx buffer 2014-05-28 12:22:42 -07:00
sccnxp.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
serial_core.c serial: uart: add hw flow control support configuration 2014-05-28 13:04:46 -07:00
serial_ks8695.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
serial_mctrl_gpio.c tty/serial: Add GPIOLIB helpers for controlling modem lines 2014-05-28 12:49:14 -07:00
serial_mctrl_gpio.h tty/serial: Add GPIOLIB helpers for controlling modem lines 2014-05-28 12:49:14 -07:00
serial_txx9.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
serial-tegra.c serial: tegra: convert to standard DMA DT bindings 2013-12-11 16:44:35 -07:00
sh-sci.c Revert "serial: sh-sci: Add device tree support for r8a7779" 2014-04-24 19:26:16 -07:00
sh-sci.h serial: sh-sci: Move overrun_bit and error_mask fields out of pdata 2013-12-24 11:17:48 +09:00
sirfsoc_uart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
sirfsoc_uart.h serial: sirf: fix spinlock deadlock issue 2014-05-28 12:22:43 -07:00
sn_console.c
st-asc.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
suncore.c
sunhv.c sparc: serial: Clean up the locking for -rt 2014-03-06 16:32:25 -05:00
sunsab.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
sunsab.h
sunsu.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
sunzilog.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
sunzilog.h
tilegx.c tile: serial: Use irq_alloc/free_hwirq 2014-05-16 14:05:20 +02:00
timbuart.c
timbuart.h
uartlite.c tty: serial: uartlite: Specify time for sending chars 2014-05-28 12:24:31 -07:00
ucc_uart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
vr41xx_siu.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
vt8500_serial.c
xilinx_uartps.c tty: xuartps: Rebrand driver as Cadence UART 2014-04-24 16:21:51 -07:00
zs.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
zs.h