diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 09:53:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 01:23:16 -0500 |
commit | d6c53c0e9bd0a83f9f9ddbc9fd80141a54d83896 (patch) | |
tree | 2b749451607e0a52d97d61af984e7aa2e3818067 | |
parent | 05c7cd39907184328f48d3e7899f9cdd653ad336 (diff) |
TTY: move low_latency to tty_port
One point is to have less places where we actually need tty pointer.
The other is that low_latency is bound to buffer processing and
buffers are now in tty_port. So it makes sense to move low_latency to
tty_port too.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 files changed, 42 insertions, 41 deletions
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index f8ae5d8eb106..942022a5bc86 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c | |||
@@ -436,7 +436,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) | |||
436 | struct tty_port *port = &info->port; | 436 | struct tty_port *port = &info->port; |
437 | 437 | ||
438 | tty->driver_data = info; | 438 | tty->driver_data = info; |
439 | tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 439 | port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
440 | 440 | ||
441 | /* | 441 | /* |
442 | * figure out which console to use (should be one already) | 442 | * figure out which console to use (should be one already) |
diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c index 54ef40ceaaed..ae61bd692b4b 100644 --- a/arch/mn10300/kernel/mn10300-serial.c +++ b/arch/mn10300/kernel/mn10300-serial.c | |||
@@ -537,7 +537,7 @@ static void mn10300_serial_receive_interrupt(struct mn10300_serial_port *port) | |||
537 | count = CIRC_CNT(port->rx_inp, port->rx_outp, MNSC_BUFFER_SIZE); | 537 | count = CIRC_CNT(port->rx_inp, port->rx_outp, MNSC_BUFFER_SIZE); |
538 | count = tty_buffer_request_room(port, count); | 538 | count = tty_buffer_request_room(port, count); |
539 | if (count == 0) { | 539 | if (count == 0) { |
540 | if (!tty->low_latency) | 540 | if (!port->low_latency) |
541 | tty_flip_buffer_push(tty); | 541 | tty_flip_buffer_push(tty); |
542 | return; | 542 | return; |
543 | } | 543 | } |
@@ -546,7 +546,7 @@ try_again: | |||
546 | /* pull chars out of the hat */ | 546 | /* pull chars out of the hat */ |
547 | ix = ACCESS_ONCE(port->rx_outp); | 547 | ix = ACCESS_ONCE(port->rx_outp); |
548 | if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0) { | 548 | if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0) { |
549 | if (push && !tty->low_latency) | 549 | if (push && !port->low_latency) |
550 | tty_flip_buffer_push(tty); | 550 | tty_flip_buffer_push(tty); |
551 | return; | 551 | return; |
552 | } | 552 | } |
@@ -678,7 +678,7 @@ insert: | |||
678 | 678 | ||
679 | count--; | 679 | count--; |
680 | if (count <= 0) { | 680 | if (count <= 0) { |
681 | if (!tty->low_latency) | 681 | if (!port->low_latency) |
682 | tty_flip_buffer_push(tty); | 682 | tty_flip_buffer_push(tty); |
683 | return; | 683 | return; |
684 | } | 684 | } |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 9bdfe27b2413..92dc7327c7aa 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -2522,7 +2522,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) | |||
2522 | goto cleanup; | 2522 | goto cleanup; |
2523 | } | 2523 | } |
2524 | 2524 | ||
2525 | tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 2525 | port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
2526 | 2526 | ||
2527 | spin_lock_irqsave(&info->netlock, flags); | 2527 | spin_lock_irqsave(&info->netlock, flags); |
2528 | if (info->netcount) { | 2528 | if (info->netcount) { |
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index dd2a57eca2e7..6dcecd40a819 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c | |||
@@ -164,7 +164,7 @@ static int if_open(struct tty_struct *tty, struct file *filp) | |||
164 | 164 | ||
165 | if (cs->port.count == 1) { | 165 | if (cs->port.count == 1) { |
166 | tty_port_tty_set(&cs->port, tty); | 166 | tty_port_tty_set(&cs->port, tty); |
167 | tty->low_latency = 1; | 167 | cs->port.low_latency = 1; |
168 | } | 168 | } |
169 | 169 | ||
170 | mutex_unlock(&cs->mutex); | 170 | mutex_unlock(&cs->mutex); |
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index 5de74e762021..666891a9a248 100644 --- a/drivers/net/caif/caif_serial.c +++ b/drivers/net/caif/caif_serial.c | |||
@@ -91,7 +91,7 @@ static inline void update_tty_status(struct ser_device *ser) | |||
91 | ser->tty->hw_stopped << 4 | | 91 | ser->tty->hw_stopped << 4 | |
92 | ser->tty->flow_stopped << 3 | | 92 | ser->tty->flow_stopped << 3 | |
93 | ser->tty->packet << 2 | | 93 | ser->tty->packet << 2 | |
94 | ser->tty->low_latency << 1 | | 94 | ser->tty->port->low_latency << 1 | |
95 | ser->tty->warned; | 95 | ser->tty->warned; |
96 | } | 96 | } |
97 | static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty) | 97 | static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty) |
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index 6e4d4b62c9a8..a41267197839 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c | |||
@@ -210,7 +210,7 @@ static int irtty_do_write(struct sir_dev *dev, const unsigned char *ptr, size_t | |||
210 | * been received, which can now be decapsulated and delivered for | 210 | * been received, which can now be decapsulated and delivered for |
211 | * further processing | 211 | * further processing |
212 | * | 212 | * |
213 | * calling context depends on underlying driver and tty->low_latency! | 213 | * calling context depends on underlying driver and tty->port->low_latency! |
214 | * for example (low_latency: 1 / 0): | 214 | * for example (low_latency: 1 / 0): |
215 | * serial.c: uart-interrupt / softint | 215 | * serial.c: uart-interrupt / softint |
216 | * usbserial: urb-complete-interrupt / softint | 216 | * usbserial: urb-complete-interrupt / softint |
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 4c6743dd5357..41b75c5ae0d5 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
@@ -968,7 +968,7 @@ static int tty3215_open(struct tty_struct *tty, struct file * filp) | |||
968 | 968 | ||
969 | tty_port_tty_set(&raw->port, tty); | 969 | tty_port_tty_set(&raw->port, tty); |
970 | 970 | ||
971 | tty->low_latency = 0; /* don't use bottom half for pushing chars */ | 971 | raw->port.low_latency = 0; /* don't use bottom half for pushing chars */ |
972 | /* | 972 | /* |
973 | * Start up 3215 device | 973 | * Start up 3215 device |
974 | */ | 974 | */ |
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c index 3ffddbb53d2f..19b7c516c07d 100644 --- a/drivers/s390/char/sclp_tty.c +++ b/drivers/s390/char/sclp_tty.c | |||
@@ -65,7 +65,7 @@ sclp_tty_open(struct tty_struct *tty, struct file *filp) | |||
65 | { | 65 | { |
66 | tty_port_tty_set(&sclp_port, tty); | 66 | tty_port_tty_set(&sclp_port, tty); |
67 | tty->driver_data = NULL; | 67 | tty->driver_data = NULL; |
68 | tty->low_latency = 0; | 68 | sclp_port.low_latency = 0; |
69 | return 0; | 69 | return 0; |
70 | } | 70 | } |
71 | 71 | ||
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index b5507f199b24..0eca99b98712 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c | |||
@@ -495,7 +495,7 @@ sclp_vt220_open(struct tty_struct *tty, struct file *filp) | |||
495 | { | 495 | { |
496 | if (tty->count == 1) { | 496 | if (tty->count == 1) { |
497 | tty_port_tty_set(&sclp_vt220_port, tty); | 497 | tty_port_tty_set(&sclp_vt220_port, tty); |
498 | tty->low_latency = 0; | 498 | sclp_vt220_port.low_latency = 0; |
499 | if (!tty->winsize.ws_row && !tty->winsize.ws_col) { | 499 | if (!tty->winsize.ws_row && !tty->winsize.ws_col) { |
500 | tty->winsize.ws_row = 24; | 500 | tty->winsize.ws_row = 24; |
501 | tty->winsize.ws_col = 80; | 501 | tty->winsize.ws_col = 80; |
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c index 43ea0593bdb0..3860e796b65f 100644 --- a/drivers/s390/char/tty3270.c +++ b/drivers/s390/char/tty3270.c | |||
@@ -860,7 +860,7 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty) | |||
860 | tty->driver_data = tp; | 860 | tty->driver_data = tp; |
861 | tty->winsize.ws_row = tp->view.rows - 2; | 861 | tty->winsize.ws_row = tp->view.rows - 2; |
862 | tty->winsize.ws_col = tp->view.cols; | 862 | tty->winsize.ws_col = tp->view.cols; |
863 | tty->low_latency = 0; | 863 | tp->port.low_latency = 0; |
864 | /* why to reassign? */ | 864 | /* why to reassign? */ |
865 | tty_port_tty_set(&tp->port, tty); | 865 | tty_port_tty_set(&tp->port, tty); |
866 | tp->inattr = TF_INPUT; | 866 | tp->inattr = TF_INPUT; |
@@ -893,7 +893,7 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty) | |||
893 | } | 893 | } |
894 | 894 | ||
895 | tty_port_tty_set(&tp->port, tty); | 895 | tty_port_tty_set(&tp->port, tty); |
896 | tty->low_latency = 0; | 896 | tp->port.low_latency = 0; |
897 | tty->winsize.ws_row = tp->view.rows - 2; | 897 | tty->winsize.ws_row = tp->view.rows - 2; |
898 | tty->winsize.ws_col = tp->view.cols; | 898 | tty->winsize.ws_col = tp->view.cols; |
899 | 899 | ||
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 2e670d0c5366..2d1357acbc23 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c | |||
@@ -1099,7 +1099,7 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state, | |||
1099 | state->custom_divisor = new_serial.custom_divisor; | 1099 | state->custom_divisor = new_serial.custom_divisor; |
1100 | port->close_delay = new_serial.close_delay * HZ/100; | 1100 | port->close_delay = new_serial.close_delay * HZ/100; |
1101 | port->closing_wait = new_serial.closing_wait * HZ/100; | 1101 | port->closing_wait = new_serial.closing_wait * HZ/100; |
1102 | tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 1102 | port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
1103 | 1103 | ||
1104 | check_and_exit: | 1104 | check_and_exit: |
1105 | if (port->flags & ASYNC_INITIALIZED) { | 1105 | if (port->flags & ASYNC_INITIALIZED) { |
@@ -1528,7 +1528,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) | |||
1528 | if (serial_paranoia_check(info, tty->name, "rs_open")) | 1528 | if (serial_paranoia_check(info, tty->name, "rs_open")) |
1529 | return -ENODEV; | 1529 | return -ENODEV; |
1530 | 1530 | ||
1531 | tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 1531 | port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
1532 | 1532 | ||
1533 | retval = startup(tty, info); | 1533 | retval = startup(tty, info); |
1534 | if (retval) { | 1534 | if (retval) { |
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c index a3ad5e14cbef..c43da7445432 100644 --- a/drivers/tty/ipwireless/tty.c +++ b/drivers/tty/ipwireless/tty.c | |||
@@ -106,7 +106,7 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp) | |||
106 | 106 | ||
107 | tty->port.tty = linux_tty; | 107 | tty->port.tty = linux_tty; |
108 | linux_tty->driver_data = tty; | 108 | linux_tty->driver_data = tty; |
109 | linux_tty->low_latency = 1; | 109 | tty->port.low_latency = 1; |
110 | 110 | ||
111 | if (tty->tty_type == TTYTYPE_MODEM) | 111 | if (tty->tty_type == TTYTYPE_MODEM) |
112 | ipwireless_ppp_open(tty->network); | 112 | ipwireless_ppp_open(tty->network); |
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 450c4507cb5b..e9cdfdfe06e9 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c | |||
@@ -1264,7 +1264,7 @@ static int mxser_set_serial_info(struct tty_struct *tty, | |||
1264 | (new_serial.flags & ASYNC_FLAGS)); | 1264 | (new_serial.flags & ASYNC_FLAGS)); |
1265 | port->close_delay = new_serial.close_delay * HZ / 100; | 1265 | port->close_delay = new_serial.close_delay * HZ / 100; |
1266 | port->closing_wait = new_serial.closing_wait * HZ / 100; | 1266 | port->closing_wait = new_serial.closing_wait * HZ / 100; |
1267 | tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 1267 | port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
1268 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST && | 1268 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST && |
1269 | (new_serial.baud_base != info->baud_base || | 1269 | (new_serial.baud_base != info->baud_base || |
1270 | new_serial.custom_divisor != | 1270 | new_serial.custom_divisor != |
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index 108122f8f3c2..0bb24378a3c0 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c | |||
@@ -508,7 +508,7 @@ static void cpm_uart_set_termios(struct uart_port *port, | |||
508 | 508 | ||
509 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); | 509 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); |
510 | if (baud < HW_BUF_SPD_THRESHOLD || | 510 | if (baud < HW_BUF_SPD_THRESHOLD || |
511 | (pinfo->port.state && pinfo->port.state->port.tty->low_latency)) | 511 | (pinfo->port.state && pinfo->port.state->port.low_latency)) |
512 | pinfo->rx_fifosize = 1; | 512 | pinfo->rx_fifosize = 1; |
513 | else | 513 | else |
514 | pinfo->rx_fifosize = RX_BUF_SIZE; | 514 | pinfo->rx_fifosize = RX_BUF_SIZE; |
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c index c82601d4dc53..52449adc09ac 100644 --- a/drivers/tty/serial/crisv10.c +++ b/drivers/tty/serial/crisv10.c | |||
@@ -3462,7 +3462,7 @@ set_serial_info(struct e100_serial *info, | |||
3462 | info->type = new_serial.type; | 3462 | info->type = new_serial.type; |
3463 | info->close_delay = new_serial.close_delay; | 3463 | info->close_delay = new_serial.close_delay; |
3464 | info->closing_wait = new_serial.closing_wait; | 3464 | info->closing_wait = new_serial.closing_wait; |
3465 | info->port.tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 3465 | info->port.low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
3466 | 3466 | ||
3467 | check_and_exit: | 3467 | check_and_exit: |
3468 | if (info->flags & ASYNC_INITIALIZED) { | 3468 | if (info->flags & ASYNC_INITIALIZED) { |
@@ -4106,7 +4106,7 @@ rs_open(struct tty_struct *tty, struct file * filp) | |||
4106 | tty->driver_data = info; | 4106 | tty->driver_data = info; |
4107 | info->port.tty = tty; | 4107 | info->port.tty = tty; |
4108 | 4108 | ||
4109 | tty->low_latency = !!(info->flags & ASYNC_LOW_LATENCY); | 4109 | info->port.low_latency = !!(info->flags & ASYNC_LOW_LATENCY); |
4110 | 4110 | ||
4111 | /* | 4111 | /* |
4112 | * If the port is in the middle of closing, bail out now | 4112 | * If the port is in the middle of closing, bail out now |
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c index bfb634ea8145..4bc6e47890b4 100644 --- a/drivers/tty/serial/ifx6x60.c +++ b/drivers/tty/serial/ifx6x60.c | |||
@@ -615,7 +615,7 @@ static int ifx_port_activate(struct tty_port *port, struct tty_struct *tty) | |||
615 | tty->driver_data = ifx_dev; | 615 | tty->driver_data = ifx_dev; |
616 | 616 | ||
617 | /* allows flip string push from int context */ | 617 | /* allows flip string push from int context */ |
618 | tty->low_latency = 1; | 618 | port->low_latency = 1; |
619 | 619 | ||
620 | /* set flag to allows data transfer */ | 620 | /* set flag to allows data transfer */ |
621 | set_bit(IFX_SPI_STATE_IO_AVAILABLE, &ifx_dev->flags); | 621 | set_bit(IFX_SPI_STATE_IO_AVAILABLE, &ifx_dev->flags); |
diff --git a/drivers/tty/serial/ioc3_serial.c b/drivers/tty/serial/ioc3_serial.c index 0f25ce49c7f9..edbdc4e45075 100644 --- a/drivers/tty/serial/ioc3_serial.c +++ b/drivers/tty/serial/ioc3_serial.c | |||
@@ -1000,7 +1000,7 @@ ioc3_change_speed(struct uart_port *the_port, | |||
1000 | 1000 | ||
1001 | the_port->ignore_status_mask = N_ALL_INPUT; | 1001 | the_port->ignore_status_mask = N_ALL_INPUT; |
1002 | 1002 | ||
1003 | state->port.tty->low_latency = 1; | 1003 | state->port.low_latency = 1; |
1004 | 1004 | ||
1005 | if (iflag & IGNPAR) | 1005 | if (iflag & IGNPAR) |
1006 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR | 1006 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR |
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c index 3b021b03ae56..86f64ed89b45 100644 --- a/drivers/tty/serial/ioc4_serial.c +++ b/drivers/tty/serial/ioc4_serial.c | |||
@@ -1740,7 +1740,7 @@ ioc4_change_speed(struct uart_port *the_port, | |||
1740 | 1740 | ||
1741 | the_port->ignore_status_mask = N_ALL_INPUT; | 1741 | the_port->ignore_status_mask = N_ALL_INPUT; |
1742 | 1742 | ||
1743 | state->port.tty->low_latency = 1; | 1743 | state->port.low_latency = 1; |
1744 | 1744 | ||
1745 | if (iflag & IGNPAR) | 1745 | if (iflag & IGNPAR) |
1746 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR | 1746 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR |
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 7ce3197087bb..e238e80cd981 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c | |||
@@ -530,7 +530,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios, | |||
530 | MAX3100_STATUS_OE; | 530 | MAX3100_STATUS_OE; |
531 | 531 | ||
532 | /* we are sending char from a workqueue so enable */ | 532 | /* we are sending char from a workqueue so enable */ |
533 | s->port.state->port.tty->low_latency = 1; | 533 | s->port.state->port.low_latency = 1; |
534 | 534 | ||
535 | if (s->poll_time > 0) | 535 | if (s->poll_time > 0) |
536 | del_timer_sync(&s->timer); | 536 | del_timer_sync(&s->timer); |
diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c index 4bcbc66c48c4..6f2d2ceb326a 100644 --- a/drivers/tty/serial/mpsc.c +++ b/drivers/tty/serial/mpsc.c | |||
@@ -970,7 +970,7 @@ static int mpsc_rx_intr(struct mpsc_port_info *pi) | |||
970 | #endif | 970 | #endif |
971 | /* Following use of tty struct directly is deprecated */ | 971 | /* Following use of tty struct directly is deprecated */ |
972 | if (tty_buffer_request_room(port, bytes_in) < bytes_in) { | 972 | if (tty_buffer_request_room(port, bytes_in) < bytes_in) { |
973 | if (tty->low_latency) | 973 | if (port->low_latency) |
974 | tty_flip_buffer_push(tty); | 974 | tty_flip_buffer_push(tty); |
975 | /* | 975 | /* |
976 | * If this failed then we will throw away the bytes | 976 | * If this failed then we will throw away the bytes |
diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c index 3b8df7b93b73..4632db7a24b7 100644 --- a/drivers/tty/serial/mrst_max3110.c +++ b/drivers/tty/serial/mrst_max3110.c | |||
@@ -495,7 +495,7 @@ static int serial_m3110_startup(struct uart_port *port) | |||
495 | | WC_BAUD_DR2; | 495 | | WC_BAUD_DR2; |
496 | 496 | ||
497 | /* as we use thread to handle tx/rx, need set low latency */ | 497 | /* as we use thread to handle tx/rx, need set low latency */ |
498 | port->state->port.tty->low_latency = 1; | 498 | port->state->port.low_latency = 1; |
499 | 499 | ||
500 | if (max->irq) { | 500 | if (max->irq) { |
501 | max->read_thread = NULL; | 501 | max->read_thread = NULL; |
diff --git a/drivers/tty/serial/msm_serial_hs.c b/drivers/tty/serial/msm_serial_hs.c index 11b7f5b2eb5f..c356ffff3c71 100644 --- a/drivers/tty/serial/msm_serial_hs.c +++ b/drivers/tty/serial/msm_serial_hs.c | |||
@@ -1400,7 +1400,7 @@ static int msm_hs_startup(struct uart_port *uport) | |||
1400 | 1400 | ||
1401 | /* do not let tty layer execute RX in global workqueue, use a | 1401 | /* do not let tty layer execute RX in global workqueue, use a |
1402 | * dedicated workqueue managed by this driver */ | 1402 | * dedicated workqueue managed by this driver */ |
1403 | uport->state->port.tty->low_latency = 1; | 1403 | uport->state->port.low_latency = 1; |
1404 | 1404 | ||
1405 | /* turn on uart clk */ | 1405 | /* turn on uart clk */ |
1406 | ret = msm_hs_init_clk_locked(uport); | 1406 | ret = msm_hs_init_clk_locked(uport); |
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 675343a20f24..b5c4e64f2990 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
@@ -867,9 +867,7 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port, | |||
867 | port->closing_wait = closing_wait; | 867 | port->closing_wait = closing_wait; |
868 | if (new_info->xmit_fifo_size) | 868 | if (new_info->xmit_fifo_size) |
869 | uport->fifosize = new_info->xmit_fifo_size; | 869 | uport->fifosize = new_info->xmit_fifo_size; |
870 | if (port->tty) | 870 | port->low_latency = (uport->flags & UPF_LOW_LATENCY) ? 1 : 0; |
871 | port->tty->low_latency = | ||
872 | (uport->flags & UPF_LOW_LATENCY) ? 1 : 0; | ||
873 | 871 | ||
874 | check_and_exit: | 872 | check_and_exit: |
875 | retval = 0; | 873 | retval = 0; |
@@ -1565,7 +1563,8 @@ static int uart_open(struct tty_struct *tty, struct file *filp) | |||
1565 | */ | 1563 | */ |
1566 | tty->driver_data = state; | 1564 | tty->driver_data = state; |
1567 | state->uart_port->state = state; | 1565 | state->uart_port->state = state; |
1568 | tty->low_latency = (state->uart_port->flags & UPF_LOW_LATENCY) ? 1 : 0; | 1566 | state->port.low_latency = |
1567 | (state->uart_port->flags & UPF_LOW_LATENCY) ? 1 : 0; | ||
1569 | tty_port_tty_set(port, tty); | 1568 | tty_port_tty_set(port, tty); |
1570 | 1569 | ||
1571 | /* | 1570 | /* |
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c index 33656b35db05..2f6967d61a80 100644 --- a/drivers/tty/synclink.c +++ b/drivers/tty/synclink.c | |||
@@ -3415,7 +3415,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp) | |||
3415 | goto cleanup; | 3415 | goto cleanup; |
3416 | } | 3416 | } |
3417 | 3417 | ||
3418 | info->port.tty->low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 3418 | info->port.low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
3419 | 3419 | ||
3420 | spin_lock_irqsave(&info->netlock, flags); | 3420 | spin_lock_irqsave(&info->netlock, flags); |
3421 | if (info->netcount) { | 3421 | if (info->netcount) { |
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 473d7406db83..9a0358a1e0dd 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c | |||
@@ -682,7 +682,7 @@ static int open(struct tty_struct *tty, struct file *filp) | |||
682 | } | 682 | } |
683 | 683 | ||
684 | mutex_lock(&info->port.mutex); | 684 | mutex_lock(&info->port.mutex); |
685 | info->port.tty->low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 685 | info->port.low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
686 | 686 | ||
687 | spin_lock_irqsave(&info->netlock, flags); | 687 | spin_lock_irqsave(&info->netlock, flags); |
688 | if (info->netcount) { | 688 | if (info->netcount) { |
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c index f5794f3d840f..419f58ff4a13 100644 --- a/drivers/tty/synclinkmp.c +++ b/drivers/tty/synclinkmp.c | |||
@@ -761,7 +761,7 @@ static int open(struct tty_struct *tty, struct file *filp) | |||
761 | goto cleanup; | 761 | goto cleanup; |
762 | } | 762 | } |
763 | 763 | ||
764 | info->port.tty->low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 764 | info->port.low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
765 | 765 | ||
766 | spin_lock_irqsave(&info->netlock, flags); | 766 | spin_lock_irqsave(&info->netlock, flags); |
767 | if (info->netcount) { | 767 | if (info->netcount) { |
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 31873e42602a..1bfe97a8e2eb 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c | |||
@@ -364,7 +364,7 @@ void tty_schedule_flip(struct tty_struct *tty) | |||
364 | { | 364 | { |
365 | struct tty_bufhead *buf = &tty->port->buf; | 365 | struct tty_bufhead *buf = &tty->port->buf; |
366 | unsigned long flags; | 366 | unsigned long flags; |
367 | WARN_ON(tty->low_latency); | 367 | WARN_ON(tty->port->low_latency); |
368 | 368 | ||
369 | spin_lock_irqsave(&buf->lock, flags); | 369 | spin_lock_irqsave(&buf->lock, flags); |
370 | if (buf->tail != NULL) | 370 | if (buf->tail != NULL) |
@@ -538,7 +538,7 @@ static void flush_to_ldisc(struct work_struct *work) | |||
538 | */ | 538 | */ |
539 | void tty_flush_to_ldisc(struct tty_struct *tty) | 539 | void tty_flush_to_ldisc(struct tty_struct *tty) |
540 | { | 540 | { |
541 | if (!tty->low_latency) | 541 | if (!tty->port->low_latency) |
542 | flush_work(&tty->port->buf.work); | 542 | flush_work(&tty->port->buf.work); |
543 | } | 543 | } |
544 | 544 | ||
@@ -547,7 +547,8 @@ void tty_flush_to_ldisc(struct tty_struct *tty) | |||
547 | * @tty: tty to push | 547 | * @tty: tty to push |
548 | * | 548 | * |
549 | * Queue a push of the terminal flip buffers to the line discipline. This | 549 | * Queue a push of the terminal flip buffers to the line discipline. This |
550 | * function must not be called from IRQ context if tty->low_latency is set. | 550 | * function must not be called from IRQ context if port->low_latency is |
551 | * set. | ||
551 | * | 552 | * |
552 | * In the event of the queue being busy for flipping the work will be | 553 | * In the event of the queue being busy for flipping the work will be |
553 | * held off and retried later. | 554 | * held off and retried later. |
@@ -565,7 +566,7 @@ void tty_flip_buffer_push(struct tty_struct *tty) | |||
565 | buf->tail->commit = buf->tail->used; | 566 | buf->tail->commit = buf->tail->used; |
566 | spin_unlock_irqrestore(&buf->lock, flags); | 567 | spin_unlock_irqrestore(&buf->lock, flags); |
567 | 568 | ||
568 | if (tty->low_latency) | 569 | if (tty->port->low_latency) |
569 | flush_to_ldisc(&buf->work); | 570 | flush_to_ldisc(&buf->work); |
570 | else | 571 | else |
571 | schedule_work(&buf->work); | 572 | schedule_work(&buf->work); |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 8db1b569c37a..f16a47a13a09 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -202,7 +202,8 @@ struct tty_port { | |||
202 | unsigned long iflags; /* TTYP_ internal flags */ | 202 | unsigned long iflags; /* TTYP_ internal flags */ |
203 | #define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */ | 203 | #define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */ |
204 | #define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ | 204 | #define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ |
205 | unsigned char console:1; /* port is a console */ | 205 | unsigned char console:1, /* port is a console */ |
206 | low_latency:1; /* direct buffer flush */ | ||
206 | struct mutex mutex; /* Locking */ | 207 | struct mutex mutex; /* Locking */ |
207 | struct mutex buf_mutex; /* Buffer alloc lock */ | 208 | struct mutex buf_mutex; /* Buffer alloc lock */ |
208 | unsigned char *xmit_buf; /* Optional buffer */ | 209 | unsigned char *xmit_buf; /* Optional buffer */ |
@@ -254,7 +255,7 @@ struct tty_struct { | |||
254 | int count; | 255 | int count; |
255 | struct winsize winsize; /* termios mutex */ | 256 | struct winsize winsize; /* termios mutex */ |
256 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; | 257 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; |
257 | unsigned char low_latency:1, warned:1; | 258 | unsigned char warned:1; |
258 | unsigned char ctrl_status; /* ctrl_lock */ | 259 | unsigned char ctrl_status; /* ctrl_lock */ |
259 | unsigned int receive_room; /* Bytes free for queue */ | 260 | unsigned int receive_room; /* Bytes free for queue */ |
260 | 261 | ||
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 14b08e376f9f..2491f6f53871 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
@@ -452,7 +452,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
452 | self->line, self->port.count); | 452 | self->line, self->port.count); |
453 | 453 | ||
454 | /* Not really used by us, but lets do it anyway */ | 454 | /* Not really used by us, but lets do it anyway */ |
455 | tty->low_latency = (self->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 455 | self->port.low_latency = (self->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
456 | 456 | ||
457 | /* | 457 | /* |
458 | * If the port is the middle of closing, bail out now | 458 | * If the port is the middle of closing, bail out now |