1
linux/drivers/usb/serial
Ian Abbott 76854ceac3 [PATCH] USB: ftdi_sio: avoid losing received data in tty-ldisc
ftdi_sio: Avoid losing bytes at tty-ldisc.

This patch was originally developed by Daniel Smertnig.  I
(Ian Abbott) made a few changes.  It has been tested by both
Daniel and I, at least for raw, non-canonical receive data
processing.

Here is Daniel's original description of the patch:

===
During a project in which I was using a FTDI 232BM to
transmit data at relative high speeds (625kBit/s), I
noticed a problem where data was lost even if flow
control was enabled: The FTDI-Driver receives 512 Bytes
of data over USB at a time, which consists of 8 64-Byte
packets. Subtracting the 2 bytes of status information
included in each packet this gives 496 "real" data
bytes per read.

This data is passed (indirectly, via the flip buffers)
to the tty line discipline which takes care of
throttling when there the free buffer space reaches
TTY_THRESHOLD_THROTTLE (128). Because the FTDI driver
processes up to 496 bytes at a time, throttling won't
happen in time and the line discipline will discard the
remaining bytes.

To avoid this the patch passes data in 62-byte blocks
to the tty layer and checks the available space in the
ldisc-buffers. If there isn't enough free space,
processing the rest of the data is delayed using a
workqueue.

Note: The original problem should be easily
reproducible with a userspace program which does slow &
small reads.
===

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Daniel Smertnig <daniel.smertnig@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-09 01:38:15 -07:00
..
airprime.c [PATCH] USB: add a driver for the AirPrime CDMA Wireless PC card. 2005-05-03 23:31:49 -07:00
belkin_sa.c [PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL 2005-04-18 17:39:34 -07:00
belkin_sa.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bus.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
console.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cp2101.c [PATCH] USB: CP2101 Add support for flow control 2005-06-03 00:04:30 -07:00
cyberjack.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cypress_m8.c [PATCH] USB: cypress_m8: add support for the DeLorme Earthmate lt-20 2005-05-16 21:44:26 -07:00
cypress_m8.h [PATCH] USB: cypress_m8: add support for the DeLorme Earthmate lt-20 2005-05-16 21:44:26 -07:00
digi_acceleport.c [PATCH] USB: usb/digi_acceleport: correct wait-queue state 2005-04-18 17:39:25 -07:00
empeg.c [PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL 2005-04-18 17:39:34 -07:00
ezusb_convert.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ezusb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ftdi_sio.c [PATCH] USB: ftdi_sio: avoid losing received data in tty-ldisc 2005-06-09 01:38:15 -07:00
ftdi_sio.h [PATCH] USB: ftdi_sio: new PID for ELV UM100 2005-05-31 14:13:59 -07:00
garmin_gps.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
generic.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
hp4x.c [PATCH] USB: fix up the HP49G+ Calculator USB Serial driver 2005-04-22 15:06:59 -07:00
io_16654.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_edgeport.c [PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL 2005-04-18 17:39:34 -07:00
io_edgeport.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_fw_boot2.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_fw_boot.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_fw_down2.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_fw_down3.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_fw_down.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_ionsp.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_tables.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_ti.c [PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL 2005-04-18 17:39:34 -07:00
io_ti.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io_usbvend.h [PATCH] USB: Spelling fixes for drivers/usb. 2005-05-03 23:31:52 -07:00
ipaq.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ipaq.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ipw.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ir-usb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Kconfig [PATCH] USB: add Option Card driver 2005-06-03 00:04:29 -07:00
keyspan_mpr_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_pda_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_pda.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_pda.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa18x_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa19_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa19qi_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa19qw_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa19w_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa26msg.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa28_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa28msg.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa28x_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa28xa_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa28xb_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa49msg.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa49w_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa49wlc_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan_usa90msg.h [PATCH] USB: Spelling fixes for drivers/usb. 2005-05-03 23:31:52 -07:00
keyspan.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
keyspan.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kl5kusb105.c [PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL 2005-04-18 17:39:34 -07:00
kl5kusb105.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kobil_sct.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kobil_sct.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile [PATCH] USB: add Option Card driver 2005-06-03 00:04:29 -07:00
Makefile-keyspan_pda_fw Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mct_u232.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mct_u232.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
omninet.c [PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL 2005-04-18 17:39:34 -07:00
option.c [PATCH] USB: add Option Card driver 2005-06-03 00:04:29 -07:00
pl2303.c [PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL 2005-04-18 17:39:34 -07:00
pl2303.h [PATCH] USB: pl2303 new vendor/model ids 2005-04-18 17:39:32 -07:00
safe_serial.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ti_fw_3410.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ti_fw_5052.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ti_usb_3410_5052.c [PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL 2005-04-18 17:39:34 -07:00
ti_usb_3410_5052.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
usb-serial.c [PATCH] USB: fix usb-serial generic initialization 2005-05-31 14:13:59 -07:00
usb-serial.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
visor.c [PATCH] USB: visor Tapwave Zodiac support patch 2005-04-18 17:39:20 -07:00
visor.h [PATCH] USB: visor Tapwave Zodiac support patch 2005-04-18 17:39:20 -07:00
whiteheat_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
whiteheat.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
whiteheat.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
xircom_pgs_fw.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
xircom_pgs.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00