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 /drivers/tty | |
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/amiserial.c | 4 | ||||
-rw-r--r-- | drivers/tty/ipwireless/tty.c | 2 | ||||
-rw-r--r-- | drivers/tty/mxser.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/cpm_uart/cpm_uart_core.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/crisv10.c | 4 | ||||
-rw-r--r-- | drivers/tty/serial/ifx6x60.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/ioc3_serial.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/ioc4_serial.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/max3100.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/mpsc.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/mrst_max3110.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/msm_serial_hs.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/serial_core.c | 7 | ||||
-rw-r--r-- | drivers/tty/synclink.c | 2 | ||||
-rw-r--r-- | drivers/tty/synclink_gt.c | 2 | ||||
-rw-r--r-- | drivers/tty/synclinkmp.c | 2 | ||||
-rw-r--r-- | drivers/tty/tty_buffer.c | 9 |
17 files changed, 25 insertions, 25 deletions
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); |