]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
USB: removal of tty->low_latency hack dating back to the old serial code
authorOliver Neukum <oliver@neukum.org>
Tue, 18 Aug 2009 14:30:26 +0000 (10:30 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 9 Sep 2009 03:17:47 +0000 (20:17 -0700)
commit 2400a2bfbd0e912193fe3b077f492d4980141813 upstream

[ cebbert@redhat.com: backport to 2.6.27 ]

USB: removal of tty->low_latency hack dating back to the old serial code

This removes tty->low_latency from all USB serial drivers that push
data into the tty layer at hard interrupt context. It's no longer needed
and actually harmful.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 files changed:
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/empeg.c
drivers/usb/serial/garmin_gps.c
drivers/usb/serial/generic.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_ti.c
drivers/usb/serial/ipaq.c
drivers/usb/serial/ipw.c
drivers/usb/serial/iuu_phoenix.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/mos7720.c
drivers/usb/serial/mos7840.c
drivers/usb/serial/option.c
drivers/usb/serial/sierra.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/visor.c

index b4d72351cb9697964fafc3ac8f2f1a4bf90cc15b..7b3df8e2a9c1283d4811b0daac7a9afd5996c786 100644 (file)
@@ -174,13 +174,6 @@ static int  cyberjack_open(struct tty_struct *tty,
        dbg("%s - usb_clear_halt", __func__);
        usb_clear_halt(port->serial->dev, port->write_urb->pipe);
 
-       /* 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.
-        */
-       if (tty)
-               tty->low_latency = 1;
-
        priv = usb_get_serial_port_data(port);
        spin_lock_irqsave(&priv->lock, flags);
        priv->rdtodo = 0;
index 22837a3f2f899e963f0d944814d222bcd2e494f5..7eb473bc6e1c3b935c58be7e74079a2409944538 100644 (file)
@@ -655,10 +655,6 @@ static int cypress_open(struct tty_struct *tty,
        priv->rx_flags = 0;
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       /* setting to zero could cause data loss */
-       if (tty)
-               tty->low_latency = 1;
-
        /* raise both lines and set termios */
        spin_lock_irqsave(&priv->lock, flags);
        priv->line_control = CONTROL_DTR | CONTROL_RTS;
index a6ab5b58d9ca5c6456a9a56eb7606e4fb18c4b0e..28ee28c03dd6706ab63e8c5075f965c8d519955f 100644 (file)
@@ -478,12 +478,6 @@ static void empeg_set_termios(struct tty_struct *tty,
        termios->c_cflag
                |= CS8;         /* character size 8 bits */
 
-       /*
-        * Force low_latency on; otherwise the pushes are scheduled;
-        * this is bad as it opens up the possibility of dropping bytes
-        * on the floor.  We don't want to drop bytes on the floor. :)
-        */
-       tty->low_latency = 1;
        tty_encode_baud_rate(tty, 115200, 115200);
 }
 
index d95382088075923ab47ae4fc869784e03c0520d4..d860071ec13157a9aeb43b4a9c62ce48182dbf21 100644 (file)
@@ -972,14 +972,6 @@ static int garmin_open(struct tty_struct *tty,
 
        dbg("%s - port %d", __func__, port->number);
 
-       /*
-        * 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.
-        */
-       if (tty)
-               tty->low_latency = 1;
-
        spin_lock_irqsave(&garmin_data_p->lock, flags);
        garmin_data_p->mode  = initial_mode;
        garmin_data_p->count = 0;
index fe84c88ec20cae94b9d1990b1e48be0ef87cb364..aa7f08bd56634bc6acb8851b5c7291ee3325c915 100644 (file)
@@ -122,12 +122,6 @@ int usb_serial_generic_open(struct tty_struct *tty,
 
        dbg("%s - port %d", __func__, port->number);
 
-       /* 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. */
-       if (tty)
-               tty->low_latency = 1;
-
        /* clear the throttle flags */
        spin_lock_irqsave(&port->lock, flags);
        port->throttled = 0;
index bfa508ddb0fed3f97062bf66e16326b765dbcbe1..183045a8710c9fd884ee01e210cf80fa0829e256 100644 (file)
@@ -193,8 +193,6 @@ static const struct divisor_table_entry divisor_table[] = {
 /* local variables */
 static int debug;
 
-static int low_latency = 1;    /* tty low latency flag, on by default */
-
 static atomic_t CmdUrbs;       /* Number of outstanding Command Write Urbs */
 
 
@@ -861,9 +859,6 @@ static int edge_open(struct tty_struct *tty,
        if (edge_port == NULL)
                return -ENODEV;
 
-       if (tty)
-               tty->low_latency = low_latency;
-
        /* see if we've set up our endpoint info yet (can't set it up
           in edge_startup as the structures were not set up at that time.) */
        serial = port->serial;
@@ -3281,6 +3276,3 @@ MODULE_FIRMWARE("edgeport/down2.fw");
 
 module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-
-module_param(low_latency, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(low_latency, "Low latency enabled or not");
index cb4c54316cf56a935691ceba62971c3fcd5963c9..0d744f0360c24af1df018fb741f1802e5fe62158 100644 (file)
@@ -76,7 +76,6 @@ struct edgeport_uart_buf_desc {
 #define EDGE_READ_URB_STOPPING 1
 #define EDGE_READ_URB_STOPPED  2
 
-#define EDGE_LOW_LATENCY       1
 #define EDGE_CLOSING_WAIT      4000    /* in .01 sec */
 
 #define EDGE_OUT_BUF_SIZE      1024
@@ -232,7 +231,6 @@ static unsigned short OperationalBuildNumber;
 
 static int debug;
 
-static int low_latency = EDGE_LOW_LATENCY;
 static int closing_wait = EDGE_CLOSING_WAIT;
 static int ignore_cpu_rev;
 static int default_uart_mode;          /* RS232 */
@@ -1838,9 +1836,6 @@ static int edge_open(struct tty_struct *tty,
        if (edge_port == NULL)
                return -ENODEV;
 
-       if (tty)
-               tty->low_latency = low_latency;
-
        port_number = port->number - port->serial->minor;
        switch (port_number) {
        case 0:
@@ -2995,9 +2990,6 @@ MODULE_FIRMWARE("edgeport/down3.bin");
 module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
-module_param(low_latency, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(low_latency, "Low latency enabled or not");
-
 module_param(closing_wait, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(closing_wait, "Maximum wait for data to drain, in .01 secs");
 
index cd9a2e138c8b35f3a3cacb4cd60525ed39d179b6..ae0b0ffa65caa65797ae8225b36a5e45dde4fee9 100644 (file)
@@ -635,13 +635,7 @@ static int ipaq_open(struct tty_struct *tty,
                priv->free_len += PACKET_SIZE;
        }
 
-       /*
-        * Force low latency on. This will immediately push data to the line
-        * discipline instead of queueing.
-        */
-
        if (tty) {
-               tty->low_latency = 1;
                /* FIXME: These two are bogus */
                tty->raw = 1;
                tty->real_raw = 1;
index a842025b9b576d4f3e8e678cf386713a9c7baf61..b1c0c9abced103f0ac574363012f32ec34ed94f1 100644 (file)
@@ -206,9 +206,6 @@ static int ipw_open(struct tty_struct *tty,
        if (!buf_flow_init)
                return -ENOMEM;
 
-       if (tty)
-               tty->low_latency = 1;
-
        /* --1: Tell the modem to initialize (we think) From sniffs this is
         *      always the first thing that gets sent to the modem during
         *      opening of the device */
index ddff37fa633904b28cb7a8ffe41c2a4804491c5f..d6da4c9e4bab607520e4971521708293c52e3296 100644 (file)
@@ -1046,7 +1046,6 @@ static int iuu_open(struct tty_struct *tty,
                tty->termios->c_oflag = 0;
                tty->termios->c_iflag = 0;
                priv->termios_initialized = 1;
-               tty->low_latency = 1;
                priv->poll = 0;
         }
        spin_unlock_irqrestore(&priv->lock, flags);
index deba28ec77e8e43cab07691bf17ed68624b9d517..5326c5967c57feb38462d4eba2e1be5581932c3e 100644 (file)
@@ -231,13 +231,7 @@ static int kobil_open(struct tty_struct *tty,
        /* someone sets the dev to 0 if the close method has been called */
        port->interrupt_in_urb->dev = port->serial->dev;
 
-
-       /* 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.
-        */
        if (tty) {
-               tty->low_latency = 1;
 
                /* Default to echo off and other sane device settings */
                tty->termios->c_lflag = 0;
index 7c4917d77c0a4bf5583ddb53806dae79cb308f9b..1c2402deaaa9e87a5b8a1d82ab17a2f839093111 100644 (file)
@@ -442,13 +442,6 @@ static int mos7720_open(struct tty_struct *tty,
        data = 0x0c;
        send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data);
 
-       /* 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.       */
-
-       if (tty)
-               tty->low_latency = 1;
-
        /* see if we've set up our endpoint info yet   *
         * (can't set it up in mos7720_startup as the  *
         * structures were not set up at that time.)   */
index 09d82062b97384f2402feda9f7401d75a76fb407..8befcbb386eff68c49810f35bceab6d6f3ce123e 100644 (file)
@@ -990,12 +990,6 @@ static int mos7840_open(struct tty_struct *tty,
        status = mos7840_set_reg_sync(port, mos7840_port->ControlRegOffset,
                                                                        Data);
 
-       /* 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.       */
-       if (tty)
-               tty->low_latency = 1;
-
        /* Check to see if we've set up our endpoint info yet    *
         * (can't set it up in mos7840_startup as the structures *
         * were not set up at that time.)                        */
index 211cd615b87765a7771df8ef589122cae3ee7f87..faa30ad8ae44ab5cb045e544a4e1fb0f1b1759bd 100644 (file)
@@ -914,9 +914,6 @@ static int option_open(struct tty_struct *tty,
                                usb_pipeout(urb->pipe), 0); */
        }
 
-       if (tty)
-               tty->low_latency = 1;
-
        option_send_setup(tty, port);
 
        return 0;
index ea1a103c99bea9f23d3a4eb7fb4f846ccbed987f..639328b0db20ffaafb2253e39414ab58bcb48a9e 100644 (file)
@@ -576,9 +576,6 @@ static int sierra_open(struct tty_struct *tty,
                }
        }
 
-       if (tty)
-               tty->low_latency = 1;
-
        sierra_send_setup(tty, port);
 
        /* start up the interrupt endpoint if we have one */
index bc5e90535dfd374d61b3ab5421f15dd97c156a34..55b9d6798f9e49c9687c6ab830937721eed02d8b 100644 (file)
 
 #define TI_TRANSFER_TIMEOUT    2
 
-#define TI_DEFAULT_LOW_LATENCY 0
 #define TI_DEFAULT_CLOSING_WAIT        4000            /* in .01 secs */
 
 /* supported setserial flags */
-#define TI_SET_SERIAL_FLAGS    (ASYNC_LOW_LATENCY)
+#define TI_SET_SERIAL_FLAGS    0
 
 /* read urb states */
 #define TI_READ_URB_RUNNING    0
@@ -212,7 +211,6 @@ static int ti_buf_get(struct circ_buf *cb, char *buf, int count);
 
 /* module parameters */
 static int debug;
-static int low_latency = TI_DEFAULT_LOW_LATENCY;
 static int closing_wait = TI_DEFAULT_CLOSING_WAIT;
 static ushort vendor_3410[TI_EXTRA_VID_PID_COUNT];
 static unsigned int vendor_3410_count;
@@ -333,10 +331,6 @@ MODULE_FIRMWARE("ti_5052.fw");
 module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes");
 
-module_param(low_latency, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(low_latency,
-               "TTY low_latency flag, 0=off, 1=on, default is off");
-
 module_param(closing_wait, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(closing_wait,
     "Maximum wait for data to drain in close, in .01 secs, default is 4000");
@@ -480,7 +474,6 @@ static int ti_startup(struct usb_serial *serial)
                spin_lock_init(&tport->tp_lock);
                tport->tp_uart_base_addr = (i == 0 ?
                                TI_UART1_BASE_ADDR : TI_UART2_BASE_ADDR);
-               tport->tp_flags = low_latency ? ASYNC_LOW_LATENCY : 0;
                tport->tp_closing_wait = closing_wait;
                init_waitqueue_head(&tport->tp_msr_wait);
                init_waitqueue_head(&tport->tp_write_wait);
@@ -560,10 +553,6 @@ static int ti_open(struct tty_struct *tty,
        if (mutex_lock_interruptible(&tdev->td_open_close_lock))
                return -ERESTARTSYS;
 
-       if (tty)
-               tty->low_latency =
-                               (tport->tp_flags & ASYNC_LOW_LATENCY) ? 1 : 0;
-
        port_number = port->number - port->serial->minor;
 
        memset(&(tport->tp_icount), 0x00, sizeof(tport->tp_icount));
@@ -1480,10 +1469,6 @@ static int ti_set_serial_info(struct ti_port *tport,
                return -EFAULT;
 
        tport->tp_flags = new_serial.flags & TI_SET_SERIAL_FLAGS;
-       /* FIXME */
-       if (port->port.tty)
-               port->port.tty->low_latency =
-                       (tport->tp_flags & ASYNC_LOW_LATENCY) ? 1 : 0;
        tport->tp_closing_wait = new_serial.closing_wait;
 
        return 0;
index cf8924f9a2cc1d461436caaefcbcfeb81b0f0168..ec33fa50a8734a04dfd8219e57bcebc57cf509ec 100644 (file)
@@ -296,14 +296,6 @@ static int visor_open(struct tty_struct *tty, struct usb_serial_port *port,
        priv->throttled = 0;
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       /*
-        * 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.
-        */
-       if (tty)
-               tty->low_latency = 1;
-
        /* Start reading from the device */
        usb_fill_bulk_urb(port->read_urb, serial->dev,
                           usb_rcvbulkpipe(serial->dev,