kernel-ark/drivers
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
..
acorn Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
acpi [PATCH] ACPI build fix 2005-05-27 08:15:05 -07:00
atm [ATM]: [drivers] kill pointless NULL checks and casts before kfree() 2005-06-02 13:04:07 -07:00
base [PATCH] driver core: restore event order for device_add() 2005-05-23 16:08:12 -07:00
block [PATCH] USB: fix ub issues 2005-06-09 01:38:11 -07:00
bluetooth Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cdrom [PATCH] ppc64 iSeries: make virtual DVD-RAMs writable again 2005-05-28 11:14:00 -07:00
char [PATCH] Replace check_bridge_mode() with (bridge->mode & AGSTAT_MODE_3_0). 2005-06-07 12:35:44 -07:00
cpufreq [PATCH] cpufreq-stats driver updates 2005-05-31 19:04:05 -07:00
crypto Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dio Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
eisa Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
fc4 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
firmware [PATCH] pcdp.c build fix 2005-05-31 14:54:18 -07:00
i2c [PATCH] I2C: ALI1563 SMBus driver fix 2005-05-31 14:03:05 -07:00
ide [PATCH] PCI: amd74xx patch for new NVIDIA device IDs 2005-05-31 14:26:38 -07:00
ieee1394 [PATCH] ieee1394: fix premature expiry of async packets 2005-05-17 07:59:24 -07:00
infiniband [PATCH] IB: fix endianness of path record MTU field 2005-05-25 15:31:28 -07:00
input [PATCH] input: disable scroll feature on AT keyboards 2005-06-07 13:39:26 -07:00
isdn [PATCH] make lots of things static 2005-05-01 08:59:29 -07:00
macintosh [PATCH] ppc32: Fix cpufreq vs. sleep issue 2005-05-28 11:14:01 -07:00
mca Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
md [PATCH] dm: Handle READA requests in dm-mpath.c 2005-06-08 16:21:14 -07:00
media [PATCH] dvb: Small cleanup 2005-05-28 16:46:10 -07:00
message [PATCH] Convert i2o to compat_ioctl 2005-04-18 12:34:15 -05:00
misc Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmc [PATCH] MMC: Proper MMC command classes support 2005-05-21 10:27:02 +01:00
mtd [PATCH] fix u32 vs. pm_message_t in drivers/mmc,mtd,scsi 2005-04-16 15:25:29 -07:00
net [TG3]: Update driver version and release date. 2005-06-08 14:15:52 -07:00
nubus Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
oprofile [PATCH] oprofile trivial user annotations 2005-04-26 07:43:42 -07:00
parisc Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
parport [PATCH] ISA_DMA Kconfig fixes - part 2 (parport_pc) 2005-05-04 07:33:13 -07:00
pci [PATCH] PCI Hotplug: fix CPCI reference counting bug 2005-06-09 01:37:59 -07:00
pcmcia [PATCH] pcmcia/ds: handle any error code 2005-05-17 07:59:21 -07:00
pnp [PATCH] drivers/pnp/pnpacpi/rsparser.c: fix an array overflow 2005-05-01 08:59:30 -07:00
s390 Automatic merge of /spare/repo/netdev-2.6 branch qeth 2005-05-25 22:11:06 -04:00
sbus [SPARC]: Eliminate local MIN/MAX macros in drivers/sbus/char/aurora.c 2005-05-15 16:01:50 -07:00
scsi Automatic merge of rsync://www.parisc-linux.org/~jejb/git/scsi-for-linus-2.6 2005-06-03 08:54:02 -07:00
serial [PATCH] Serial: remove unused variable in sa1100 driver 2005-06-08 19:26:47 +01:00
sh Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sn Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tc Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
telephony [PATCH] ixj* - compile warning cleanup 2005-05-05 16:36:48 -07:00
usb [PATCH] USB: ftdi_sio: avoid losing received data in tty-ldisc 2005-06-09 01:38:15 -07:00
video [PATCH] intelfb section fix 2005-05-28 16:46:09 -07:00
w1 [PATCH] w1_smem: w1 ID is only 8 bytes long. 2005-04-18 21:16:57 -07:00
zorro Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Kconfig Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00