Skip to content

Commit 2400a2b

Browse files
Oliver Neukumgregkh
authored andcommitted
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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 212b8f0 commit 2400a2b

18 files changed

Lines changed: 1 addition & 111 deletions

‎drivers/usb/serial/cyberjack.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,6 @@ static int cyberjack_open(struct tty_struct *tty,
175175
dbg("%s - usb_clear_halt", __func__);
176176
usb_clear_halt(port->serial->dev, port->write_urb->pipe);
177177

178-
/* force low_latency on so that our tty_push actually forces
179-
* the data through, otherwise it is scheduled, and with high
180-
* data rates (like with OHCI) data can get lost.
181-
*/
182-
if (tty)
183-
tty->low_latency = 1;
184-
185178
priv = usb_get_serial_port_data(port);
186179
spin_lock_irqsave(&priv->lock, flags);
187180
priv->rdtodo = 0;

‎drivers/usb/serial/cypress_m8.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,6 @@ static int cypress_open(struct tty_struct *tty,
656656
priv->rx_flags = 0;
657657
spin_unlock_irqrestore(&priv->lock, flags);
658658

659-
/* setting to zero could cause data loss */
660-
if (tty)
661-
tty->low_latency = 1;
662-
663659
/* raise both lines and set termios */
664660
spin_lock_irqsave(&priv->lock, flags);
665661
priv->line_control = CONTROL_DTR | CONTROL_RTS;

‎drivers/usb/serial/empeg.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,6 @@ static void empeg_set_termios(struct tty_struct *tty,
478478
termios->c_cflag
479479
|= CS8; /* character size 8 bits */
480480

481-
/*
482-
* Force low_latency on; otherwise the pushes are scheduled;
483-
* this is bad as it opens up the possibility of dropping bytes
484-
* on the floor. We don't want to drop bytes on the floor. :)
485-
*/
486-
tty->low_latency = 1;
487481
tty_encode_baud_rate(tty, 115200, 115200);
488482
}
489483

‎drivers/usb/serial/garmin_gps.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -973,14 +973,6 @@ static int garmin_open(struct tty_struct *tty,
973973

974974
dbg("%s - port %d", __func__, port->number);
975975

976-
/*
977-
* Force low_latency on so that our tty_push actually forces the data
978-
* through, otherwise it is scheduled, and with high data rates (like
979-
* with OHCI) data can get lost.
980-
*/
981-
if (tty)
982-
tty->low_latency = 1;
983-
984976
spin_lock_irqsave(&garmin_data_p->lock, flags);
985977
garmin_data_p->mode = initial_mode;
986978
garmin_data_p->count = 0;

‎drivers/usb/serial/generic.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ int usb_serial_generic_open(struct tty_struct *tty,
122122

123123
dbg("%s - port %d", __func__, port->number);
124124

125-
/* force low_latency on so that our tty_push actually forces the data
126-
through, otherwise it is scheduled, and with high data rates (like
127-
with OHCI) data can get lost. */
128-
if (tty)
129-
tty->low_latency = 1;
130-
131125
/* clear the throttle flags */
132126
spin_lock_irqsave(&port->lock, flags);
133127
port->throttled = 0;

‎drivers/usb/serial/io_edgeport.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ static const struct divisor_table_entry divisor_table[] = {
193193
/* local variables */
194194
static int debug;
195195

196-
static int low_latency = 1; /* tty low latency flag, on by default */
197-
198196
static atomic_t CmdUrbs; /* Number of outstanding Command Write Urbs */
199197

200198

@@ -867,9 +865,6 @@ static int edge_open(struct tty_struct *tty,
867865
if (edge_port == NULL)
868866
return -ENODEV;
869867

870-
if (tty)
871-
tty->low_latency = low_latency;
872-
873868
/* see if we've set up our endpoint info yet (can't set it up
874869
in edge_startup as the structures were not set up at that time.) */
875870
serial = port->serial;
@@ -3299,6 +3294,3 @@ MODULE_FIRMWARE("edgeport/down2.fw");
32993294

33003295
module_param(debug, bool, S_IRUGO | S_IWUSR);
33013296
MODULE_PARM_DESC(debug, "Debug enabled or not");
3302-
3303-
module_param(low_latency, bool, S_IRUGO | S_IWUSR);
3304-
MODULE_PARM_DESC(low_latency, "Low latency enabled or not");

‎drivers/usb/serial/io_ti.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ struct edgeport_uart_buf_desc {
7676
#define EDGE_READ_URB_STOPPING 1
7777
#define EDGE_READ_URB_STOPPED 2
7878

79-
#define EDGE_LOW_LATENCY 1
8079
#define EDGE_CLOSING_WAIT 4000 /* in .01 sec */
8180

8281
#define EDGE_OUT_BUF_SIZE 1024
@@ -232,7 +231,6 @@ static unsigned short OperationalBuildNumber;
232231

233232
static int debug;
234233

235-
static int low_latency = EDGE_LOW_LATENCY;
236234
static int closing_wait = EDGE_CLOSING_WAIT;
237235
static int ignore_cpu_rev;
238236
static int default_uart_mode; /* RS232 */
@@ -1850,9 +1848,6 @@ static int edge_open(struct tty_struct *tty,
18501848
if (edge_port == NULL)
18511849
return -ENODEV;
18521850

1853-
if (tty)
1854-
tty->low_latency = low_latency;
1855-
18561851
port_number = port->number - port->serial->minor;
18571852
switch (port_number) {
18581853
case 0:
@@ -3008,9 +3003,6 @@ MODULE_FIRMWARE("edgeport/down3.bin");
30083003
module_param(debug, bool, S_IRUGO | S_IWUSR);
30093004
MODULE_PARM_DESC(debug, "Debug enabled or not");
30103005

3011-
module_param(low_latency, bool, S_IRUGO | S_IWUSR);
3012-
MODULE_PARM_DESC(low_latency, "Low latency enabled or not");
3013-
30143006
module_param(closing_wait, int, S_IRUGO | S_IWUSR);
30153007
MODULE_PARM_DESC(closing_wait, "Maximum wait for data to drain, in .01 secs");
30163008

‎drivers/usb/serial/ipaq.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,13 +631,7 @@ static int ipaq_open(struct tty_struct *tty,
631631
priv->free_len += PACKET_SIZE;
632632
}
633633

634-
/*
635-
* Force low latency on. This will immediately push data to the line
636-
* discipline instead of queueing.
637-
*/
638-
639634
if (tty) {
640-
tty->low_latency = 1;
641635
/* FIXME: These two are bogus */
642636
tty->raw = 1;
643637
tty->real_raw = 1;

‎drivers/usb/serial/ipw.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,6 @@ static int ipw_open(struct tty_struct *tty,
207207
if (!buf_flow_init)
208208
return -ENOMEM;
209209

210-
if (tty)
211-
tty->low_latency = 1;
212-
213210
/* --1: Tell the modem to initialize (we think) From sniffs this is
214211
* always the first thing that gets sent to the modem during
215212
* opening of the device */

‎drivers/usb/serial/iuu_phoenix.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,6 @@ static int iuu_open(struct tty_struct *tty,
10511051
tty->termios->c_oflag = 0;
10521052
tty->termios->c_iflag = 0;
10531053
priv->termios_initialized = 1;
1054-
tty->low_latency = 1;
10551054
priv->poll = 0;
10561055
}
10571056
spin_unlock_irqrestore(&priv->lock, flags);

0 commit comments

Comments
 (0)