Well after all my insistence on the fact that the problem with the Visor
driver and OHCI being a user program problem, and not the driver, I'm
ready to eat those words.

Attached is a patch against 2.4.0-test11-pre4, but it should apply
almost just fine to the 2.2.18preX (with the exception of the initial
comment, which doesn't matter).  Could anyone with a Visor and a OHCI
host controller, please try this out, and let me know if it does or does
not work for you?  I know there are a bunch of PPC people out there just
itching to use the USB portion of their Visors :)

I have successfully backed up my entire Visor (just over 2Mb of data)
over OHCI 3 times in a row with no problems.  I could never do that in
the past.

Thanks for this fix goes out to John Ripley (who doesn't realize it) who
wrote the initial empeg-car USB driver a long time ago, and to Gary
Brubaker (who also doesn't realize it) who has written a updated empeg
usb driver using the usb-serial interface.  In looking over his driver,
I noticed a fix like this, that is necessary for large amounts of data
being shoved through the tty layer.  Thanks guys!

greg k-h
(potentially about to start wearing a large bag...)

-- 
greg@(kroah|wirex).com
diff -Naur -X dontdiff linux-2.4.0-test11-pre4/drivers/usb/serial/visor.c 
linux-2.4.0-test11-pre4-greg/drivers/usb/serial/visor.c
--- linux-2.4.0-test11-pre4/drivers/usb/serial/visor.c  Sun Nov 12 22:27:59 2000
+++ linux-2.4.0-test11-pre4-greg/drivers/usb/serial/visor.c     Mon Nov 13 00:17:20 
+2000
@@ -11,6 +11,10 @@
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  * 
+ * (11/12/2000) gkh
+ *     Fixed bug with data being dropped on the floor by forcing tty->low_latency
+ *     to be on.  Hopefully this fixes the OHCI issue!
+ *
  * (11/01/2000) Adam J. Richter
  *     usb_device_id table support
  * 
@@ -171,6 +175,11 @@
                bytes_in = 0;
                bytes_out = 0;
 
+               /* force low_latency on so that our tty_push actually forces the data 
+through, 
+                  otherwise it is scheduled, and with high data rates (like with 
+OHCI) data
+                  can get lost. */
+               port->tty->low_latency = 1;
+               
                /* Start reading from the device */
                FILL_BULK_URB(port->read_urb, serial->dev, 
                              usb_rcvbulkpipe(serial->dev, 
port->bulk_in_endpointAddress),
@@ -348,6 +357,11 @@
        tty = port->tty;
        if (urb->actual_length) {
                for (i = 0; i < urb->actual_length ; ++i) {
+                       /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop 
+them. */
+                       if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
+                               tty_flip_buffer_push(tty);
+                               }
+                       /* this doesn't actually push the data through unless 
+tty->low_latency is set */
                        tty_insert_flip_char(tty, data[i], 0);
                }
                tty_flip_buffer_push(tty);

PGP signature

Reply via email to