WSL2-Linux-Kernel/drivers/serial
Dick Hollenbeck bca476139d serial: 8250: add serial transmitter fully empty test
When controlling an industrial radio modem it can be necessary to
manipulate the handshake lines in order to control the radio modem's
transmitter, from userspace.

The transmitter should not be turned off before all characters have been
transmitted.  serial8250_tx_empty() was reporting that all characters were
transmitted before they actually were.

===

Discovered in parallel with more testing and analysis by Kees Schoenmakers
as follows:

I ran into an NetMos 9835 serial pci board which behaves a little
different than the standard.  This type of expansion board is very common.

"Standard" 8250 compatible devices clear the 'UART_LST_TEMT" bit together
with the "UART_LSR_THRE" bit when writing data to the device.

The NetMos device does it slightly different

I believe that the TEMT bit is coupled to the shift register.  The problem
is that after writing data to the device and very quickly after that one
does call serial8250_tx_empty, it returns the wrong information.

My patch makes the test more robust (and solves the problem) and it does
not affect the already correct devices.

Alan:

  We may yet need to quirk this but now we know which chips we have a
  way to do that should we find this breaks some other 8250 clone with
  dodgy THRE.

Signed-off-by: Dick Hollenbeck <dick@softplc.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Kees Schoenmakers <k.schoenmakers@sigmae.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-02-16 15:55:51 -08:00
..
cpm_uart Fix build of cpm_uart due to core changes 2009-09-24 17:01:22 +10:00
jsm jsm: adding EEH handlers 2009-12-11 15:18:03 -08:00
8250.c serial: 8250: add serial transmitter fully empty test 2010-02-16 15:55:51 -08:00
8250.h serial: 8250: add IRQ trigger support 2009-09-19 13:13:19 -07:00
8250_accent.c
8250_acorn.c
8250_boca.c
8250_early.c 8250: switch 8250 drivers to use _nocache ioremaps 2008-05-01 08:04:00 -07:00
8250_exar_st16c554.c
8250_fourport.c
8250_gsc.c serial: 8250_gsc: fix printk format error 2009-05-29 08:40:02 -07:00
8250_hp300.c 8250_hp300: coding style 2008-02-08 09:22:25 -08:00
8250_hub6.c 8250_hub6: codding style 2008-02-08 09:22:25 -08:00
8250_mca.c
8250_pci.c serial: add support for the Lava Quattro PCI quad-port 16550A card 2009-11-12 07:25:57 -08:00
8250_pnp.c serial: 8250_pnp: use wildcard for serial Wacom tablets 2010-01-20 15:03:27 -08:00
21285.c ARM: 5874/1: serial21285: fix disable_irq-from-interrupt-handler deadlock 2010-01-11 15:39:21 +00:00
68328serial.c serial, 8250: remove NR_IRQ usage 2008-10-16 16:52:02 +02:00
68328serial.h
68360serial.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2009-12-09 19:03:16 -08:00
Makefile sparc: Support for GRLIB APBUART serial port 2009-11-04 08:44:54 -08:00
amba-pl010.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
amba-pl011.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
apbuart.c apbuart: Use of_find_node_by_path to find root node. 2009-11-13 13:25:06 -08:00
apbuart.h sparc: Support for GRLIB APBUART serial port 2009-11-04 08:44:54 -08:00
atmel_serial.c atmel_serial: fix bad BUILD_BUG_ON() usage 2009-10-29 07:39:30 -07:00
bcm63xx_uart.c bcm63xx_uart: Fix serial driver compile breakage. 2009-11-30 16:38:32 -08:00
bfin_5xx.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
bfin_sport_uart.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
bfin_sport_uart.h Blackfin serial driver: this driver enable SPORTs on Blackfin emulate UART 2008-04-30 08:29:30 -07:00
clps711x.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
crisv10.c CRIS: fix defconfig build failure 2009-08-31 18:38:16 +02:00
crisv10.h tty: Use the generic RS485 ioctl on CRIS 2009-04-07 08:44:05 -07:00
dz.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
dz.h dz: clean up and improve the setup of termios settings 2008-02-07 08:42:24 -08:00
icom.c icom: convert space to tabs 2009-10-01 16:11:15 -07:00
icom.h Coding style fix drivers/serial/icom.h 2008-02-03 14:47:38 +02:00
imx.c serial: imx: bit &/| confusion 2010-01-20 15:03:30 -08:00
ioc3_serial.c ioc3/ioc4: various section fixes 2009-12-15 08:53:27 -08:00
ioc4_serial.c ioc3/ioc4: fix error path on driver registration 2009-12-15 08:53:27 -08:00
ip22zilog.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
ip22zilog.h
kgdboc.c tty: The big operations rework 2008-04-30 08:29:47 -07:00
m32r_sio.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
m32r_sio.h
m32r_sio_reg.h
max3100.c spi: prefix modalias with "spi:" 2009-09-23 07:39:43 -07:00
mcf.c m68knommu: move mcf_remove to .devexit.text 2009-12-04 11:45:30 +10:00
mpc52xx_uart.c drivers/serial/mpc52xx_uart.c: Use UPIO_MEM rather than SERIAL_IO_MEM 2009-10-15 09:58:28 -06:00
mpsc.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
msm_serial.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
msm_serial.h msm_serial: serial driver for MSM7K onboard serial peripheral. 2009-06-22 11:32:25 -07:00
mux.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
netx-serial.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
nwpserial.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
of_serial.c tty/of_serial: add missing ns16550a id 2009-11-30 16:38:44 -08:00
pmac_zilog.c serial/pmac_zilog: Workaround problem due to interrupt on closed port 2010-01-15 13:26:13 +11:00
pmac_zilog.h tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
pnx8xxx_uart.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
pxa.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
s3c24a0.c ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
s3c2400.c ARM: S3C24XX: serial: Fix section mismatch warnings 2009-07-30 23:56:41 +01:00
s3c2410.c ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
s3c2412.c ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
s3c2440.c ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
s3c6400.c ARM: S3C64XX: serial: Fix section mismatch warning 2009-07-30 23:56:41 +01:00
sa1100.c ARM: Fix SA1100 Neponset serial section mismatch 2009-09-28 18:06:16 +01:00
samsung.c ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
samsung.h ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
sb1250-duart.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
sc26xx.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
serial_core.c serial: Fix crash if the minimum rate of the device is > 9600 baud 2010-01-20 15:03:29 -08:00
serial_cs.c fmvj18x_cs: add new id (Panasonic lan & modem card) 2010-01-23 01:08:52 -08:00
serial_ks8695.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
serial_lh7a40x.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
serial_txx9.c serial_txx9: use container_of() instead of direct cast 2009-10-01 16:11:15 -07:00
sh-sci.c serial: sh-sci: using correct fifo size for SCIF and SCIFA ports. 2010-01-15 08:33:20 +09:00
sh-sci.h serial: sh-sci: Convert tremaining ctrl_xxx I/O routines to __raw_xxx. 2009-12-24 14:52:43 +09:00
sn_console.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
suncore.c serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
suncore.h serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
sunhv.c serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
sunsab.c serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
sunsab.h
sunsu.c sunsu: Use sunserial_console_termios() in sunsu_console_setup(). 2009-11-24 14:12:50 -08:00
sunzilog.c serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
sunzilog.h
timbuart.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
timbuart.h serial: Added Timberdale UART driver 2009-06-11 08:51:06 -07:00
uartlite.c uartlite: fix crash when using as console 2010-02-02 18:11:22 -08:00
ucc_uart.c firmware_class: make request_firmware_nowait more useful 2009-12-11 11:24:52 -08:00
vr41xx_siu.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
zs.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
zs.h