linux/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
jsm
8250.c serial: 8250: add serial transmitter fully empty test 2010-02-16 15:55:51 -08:00
8250.h
8250_accent.c
8250_acorn.c
8250_boca.c
8250_early.c
8250_exar_st16c554.c
8250_fourport.c
8250_gsc.c
8250_hp300.c
8250_hub6.c
8250_mca.c
8250_pci.c
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
68328serial.h
68360serial.c
Kconfig
Makefile
amba-pl010.c
amba-pl011.c
apbuart.c
apbuart.h
atmel_serial.c
bcm63xx_uart.c
bfin_5xx.c
bfin_sport_uart.c
bfin_sport_uart.h
clps711x.c
crisv10.c
crisv10.h
dz.c
dz.h
icom.c
icom.h
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
ip22zilog.h
kgdboc.c
m32r_sio.c
m32r_sio.h
m32r_sio_reg.h
max3100.c
mcf.c
mpc52xx_uart.c
mpsc.c
msm_serial.c
msm_serial.h
mux.c
netx-serial.c
nwpserial.c
of_serial.c
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
pnx8xxx_uart.c
pxa.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
s3c24a0.c
s3c2400.c
s3c2410.c
s3c2412.c
s3c2440.c
s3c6400.c
sa1100.c
samsung.c
samsung.h
sb1250-duart.c
sc26xx.c
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_lh7a40x.c
serial_txx9.c
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
suncore.c
suncore.h
sunhv.c
sunsab.c
sunsab.h
sunsu.c
sunzilog.c
sunzilog.h
timbuart.c
timbuart.h
uartlite.c uartlite: fix crash when using as console 2010-02-02 18:11:22 -08:00
ucc_uart.c
vr41xx_siu.c
zs.c
zs.h