We've been stress testing the Keyspan USA 49W adapters to see if they
are suitable for our application using kernel 2.4.18.

We've discovered a data corruption problem however.  If you
write(fd,buf,len) data packets such that len % 63 >= 32 && len % 63 <
63 then there is a good chance that the output data gets corrupted.
To be specific - you can write(fd, buf, 64) all day with no problems
but write(fd, buf, 100) will get corruptions.

The data stream gets corrupted in a very specific way - there are no
bytes added or removed to the serial output but there is one byte
overwritten with null (0x00) with 0,1 or 2 more corrupted bytes after
it.

We came up with a patch (see end) for the problem - with this we have
transmitted and received many gigabytes of data over 20 serial ports
at a maxed out 115200 baud with no errors at all.  Obviously this
patch is a workaround for a deeper problem which could be in the linux
kernel USB layers, the keyspan firmware or the hardware I don't know.

This was tested on a micro atx board with usb-uhci and this chipset.
The same errors ocurr but less frequently with uhci instead of
usb-uhci.

00:07.2 USB Controller: VIA Technologies, Inc. UHCI USB (rev 0a) (prog-if 00 [UHCI])
        Subsystem: Unknown device 0925:1234
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- 
SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR-
        Latency: 32, cache line size 08
        Interrupt: pin D routed to IRQ 10
        Region 4: I/O ports at d400 [size=32]
        Capabilities: [80] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

However (and this is what makes a simple bug report not so simple) the
unpatched keyspan driver works absolutely perfectly on my desktop
machine.  On my laptop it doesn't give this error either but it spends
so much time messing around in the BIOS with power management stuff
that it is always dropping packets.

Does anyone have any more ideas as to what is going on or ideas as to
what to try next?

--- /usr/src/linux-2.4.18/drivers/usb/serial/keyspan.c  Fri Dec 21 17:41:55 2001
+++ keyspan.c   Thu Mar 21 16:33:28 2002
@@ -355,6 +355,8 @@
                todo = left;
                if (todo > 63)
                        todo = 63;
+               else if (todo > 31) /* workaround fix for bad region */
+                       todo = 31;
 
                flip = p_priv->out_flip;

-- 
Nick Craig-Wood
[EMAIL PROTECTED]

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to