Re: ftdi_sio serial adapter data toggle problem.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 07, 2010 at 11:25:21AM -0400, Dave Mielke wrote:
> One of our (brltty) users is reporting a problem which has begun to occur with 
> his braille display. It turns out that the problem is actually with how Linux 
> is interacting with the USB to serial adapter which he's using. dmesg reports 
> that Linux is using its ftdi_sio driver.
> 
> The problem is that the ftdi_sio driver's data toggle and the ftdi_sio 
> adapter's data toggle are now at risk of starting out (opening of ttyUSB0) out 
> of sync. I'm sure this is the problem because it's seemingly random, and, when 
> it occurs, it corrects after a few data transfer attempts. As you'll see below, 
> this is a new problem which the ftdi_sio driver didn't used to have.  He's 
> using a Debian system, so my references to kernel releases are what that 
> distribution calls them.
> 
> His ftdi_sio adapter worked fine up until, and including, kernel 2.6.32-3-686. 
> Then, when he upgraded to kernel 2.6.32-5-686-18, the problem started to occur. 
> It still occurs on Debian Unstable's kernel 2.6.32-5-686-19, and it even still 
> occurs on Debian Experimental's kernel 2.6.35-rc6-686, so I suspect this is a 
> problem which hasn't been addressed yet.

Ick, I've heard of this happening before on some devices, but I thought
we had fixed all of these a long time ago.

I think it is due to a host controller hardware bug somewhere,
especially given the work-arounds I've seen for this issue in a number
of different Windows USB drivers that we had to also add to some Linux
drivers.

Can this user test a patch out if I create one?  If so, try the
one below please.

thanks,

greg k-h


diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index e298dc4..53517cc 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -805,6 +805,7 @@ static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base);
 static __u32 ftdi_232bm_baud_to_divisor(int baud);
 static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base);
 static __u32 ftdi_2232h_baud_to_divisor(int baud);
+static int ftdi_attach(struct usb_serial *);
 
 static struct usb_serial_driver ftdi_sio_device = {
 	.driver = {
@@ -832,6 +833,7 @@ static struct usb_serial_driver ftdi_sio_device = {
 	.ioctl =		ftdi_ioctl,
 	.set_termios =		ftdi_set_termios,
 	.break_ctl =		ftdi_break_ctl,
+	.attach = 		ftdi_attach,
 };
 
 
@@ -1891,6 +1893,12 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state)
 
 }
 
+static int ftdi_attach(struct usb_serial *serial)
+{
+	usb_reset_device(serial->dev);
+	return 0;
+}
+
 /* old_termios contains the original termios settings and tty->termios contains
  * the new setting to be used
  * WARNING: set_termios calls this with old_termios in kernel space
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux