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>
This commit is contained in:
Jiri Slaby
2013-01-03 15:53:05 +01:00
committed by Greg Kroah-Hartman
parent 05c7cd3990
commit d6c53c0e9b
29 changed files with 42 additions and 41 deletions
+1 -1
View File
@@ -436,7 +436,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
struct tty_port *port = &info->port; struct tty_port *port = &info->port;
tty->driver_data = info; tty->driver_data = info;
tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
/* /*
* figure out which console to use (should be one already) * figure out which console to use (should be one already)
+3 -3
View File
@@ -537,7 +537,7 @@ static void mn10300_serial_receive_interrupt(struct mn10300_serial_port *port)
count = CIRC_CNT(port->rx_inp, port->rx_outp, MNSC_BUFFER_SIZE); count = CIRC_CNT(port->rx_inp, port->rx_outp, MNSC_BUFFER_SIZE);
count = tty_buffer_request_room(port, count); count = tty_buffer_request_room(port, count);
if (count == 0) { if (count == 0) {
if (!tty->low_latency) if (!port->low_latency)
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
return; return;
} }
@@ -546,7 +546,7 @@ try_again:
/* pull chars out of the hat */ /* pull chars out of the hat */
ix = ACCESS_ONCE(port->rx_outp); ix = ACCESS_ONCE(port->rx_outp);
if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0) { if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0) {
if (push && !tty->low_latency) if (push && !port->low_latency)
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
return; return;
} }
@@ -678,7 +678,7 @@ insert:
count--; count--;
if (count <= 0) { if (count <= 0) {
if (!tty->low_latency) if (!port->low_latency)
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
return; return;
} }
+1 -1
View File
@@ -2522,7 +2522,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
goto cleanup; goto cleanup;
} }
tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
spin_lock_irqsave(&info->netlock, flags); spin_lock_irqsave(&info->netlock, flags);
if (info->netcount) { if (info->netcount) {
+1 -1
View File
@@ -164,7 +164,7 @@ static int if_open(struct tty_struct *tty, struct file *filp)
if (cs->port.count == 1) { if (cs->port.count == 1) {
tty_port_tty_set(&cs->port, tty); tty_port_tty_set(&cs->port, tty);
tty->low_latency = 1; cs->port.low_latency = 1;
} }
mutex_unlock(&cs->mutex); mutex_unlock(&cs->mutex);
+1 -1
View File
@@ -91,7 +91,7 @@ static inline void update_tty_status(struct ser_device *ser)
ser->tty->hw_stopped << 4 | ser->tty->hw_stopped << 4 |
ser->tty->flow_stopped << 3 | ser->tty->flow_stopped << 3 |
ser->tty->packet << 2 | ser->tty->packet << 2 |
ser->tty->low_latency << 1 | ser->tty->port->low_latency << 1 |
ser->tty->warned; ser->tty->warned;
} }
static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty) static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty)
+1 -1
View File
@@ -210,7 +210,7 @@ static int irtty_do_write(struct sir_dev *dev, const unsigned char *ptr, size_t
* been received, which can now be decapsulated and delivered for * been received, which can now be decapsulated and delivered for
* further processing * further processing
* *
* calling context depends on underlying driver and tty->low_latency! * calling context depends on underlying driver and tty->port->low_latency!
* for example (low_latency: 1 / 0): * for example (low_latency: 1 / 0):
* serial.c: uart-interrupt / softint * serial.c: uart-interrupt / softint
* usbserial: urb-complete-interrupt / softint * usbserial: urb-complete-interrupt / softint
+1 -1
View File
@@ -968,7 +968,7 @@ static int tty3215_open(struct tty_struct *tty, struct file * filp)
tty_port_tty_set(&raw->port, tty); tty_port_tty_set(&raw->port, tty);
tty->low_latency = 0; /* don't use bottom half for pushing chars */ raw->port.low_latency = 0; /* don't use bottom half for pushing chars */
/* /*
* Start up 3215 device * Start up 3215 device
*/ */
+1 -1
View File
@@ -65,7 +65,7 @@ sclp_tty_open(struct tty_struct *tty, struct file *filp)
{ {
tty_port_tty_set(&sclp_port, tty); tty_port_tty_set(&sclp_port, tty);
tty->driver_data = NULL; tty->driver_data = NULL;
tty->low_latency = 0; sclp_port.low_latency = 0;
return 0; return 0;
} }
+1 -1
View File
@@ -495,7 +495,7 @@ sclp_vt220_open(struct tty_struct *tty, struct file *filp)
{ {
if (tty->count == 1) { if (tty->count == 1) {
tty_port_tty_set(&sclp_vt220_port, tty); tty_port_tty_set(&sclp_vt220_port, tty);
tty->low_latency = 0; sclp_vt220_port.low_latency = 0;
if (!tty->winsize.ws_row && !tty->winsize.ws_col) { if (!tty->winsize.ws_row && !tty->winsize.ws_col) {
tty->winsize.ws_row = 24; tty->winsize.ws_row = 24;
tty->winsize.ws_col = 80; tty->winsize.ws_col = 80;
+2 -2
View File
@@ -860,7 +860,7 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty)
tty->driver_data = tp; tty->driver_data = tp;
tty->winsize.ws_row = tp->view.rows - 2; tty->winsize.ws_row = tp->view.rows - 2;
tty->winsize.ws_col = tp->view.cols; tty->winsize.ws_col = tp->view.cols;
tty->low_latency = 0; tp->port.low_latency = 0;
/* why to reassign? */ /* why to reassign? */
tty_port_tty_set(&tp->port, tty); tty_port_tty_set(&tp->port, tty);
tp->inattr = TF_INPUT; tp->inattr = TF_INPUT;
@@ -893,7 +893,7 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty)
} }
tty_port_tty_set(&tp->port, tty); tty_port_tty_set(&tp->port, tty);
tty->low_latency = 0; tp->port.low_latency = 0;
tty->winsize.ws_row = tp->view.rows - 2; tty->winsize.ws_row = tp->view.rows - 2;
tty->winsize.ws_col = tp->view.cols; tty->winsize.ws_col = tp->view.cols;
+2 -2
View File
@@ -1099,7 +1099,7 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state,
state->custom_divisor = new_serial.custom_divisor; state->custom_divisor = new_serial.custom_divisor;
port->close_delay = new_serial.close_delay * HZ/100; port->close_delay = new_serial.close_delay * HZ/100;
port->closing_wait = new_serial.closing_wait * HZ/100; port->closing_wait = new_serial.closing_wait * HZ/100;
tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
check_and_exit: check_and_exit:
if (port->flags & ASYNC_INITIALIZED) { if (port->flags & ASYNC_INITIALIZED) {
@@ -1528,7 +1528,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
if (serial_paranoia_check(info, tty->name, "rs_open")) if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV; return -ENODEV;
tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
retval = startup(tty, info); retval = startup(tty, info);
if (retval) { if (retval) {
+1 -1
View File
@@ -106,7 +106,7 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)
tty->port.tty = linux_tty; tty->port.tty = linux_tty;
linux_tty->driver_data = tty; linux_tty->driver_data = tty;
linux_tty->low_latency = 1; tty->port.low_latency = 1;
if (tty->tty_type == TTYTYPE_MODEM) if (tty->tty_type == TTYTYPE_MODEM)
ipwireless_ppp_open(tty->network); ipwireless_ppp_open(tty->network);
+1 -1
View File
@@ -1264,7 +1264,7 @@ static int mxser_set_serial_info(struct tty_struct *tty,
(new_serial.flags & ASYNC_FLAGS)); (new_serial.flags & ASYNC_FLAGS));
port->close_delay = new_serial.close_delay * HZ / 100; port->close_delay = new_serial.close_delay * HZ / 100;
port->closing_wait = new_serial.closing_wait * HZ / 100; port->closing_wait = new_serial.closing_wait * HZ / 100;
tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST && if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST &&
(new_serial.baud_base != info->baud_base || (new_serial.baud_base != info->baud_base ||
new_serial.custom_divisor != new_serial.custom_divisor !=
+1 -1
View File
@@ -508,7 +508,7 @@ static void cpm_uart_set_termios(struct uart_port *port,
baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);
if (baud < HW_BUF_SPD_THRESHOLD || if (baud < HW_BUF_SPD_THRESHOLD ||
(pinfo->port.state && pinfo->port.state->port.tty->low_latency)) (pinfo->port.state && pinfo->port.state->port.low_latency))
pinfo->rx_fifosize = 1; pinfo->rx_fifosize = 1;
else else
pinfo->rx_fifosize = RX_BUF_SIZE; pinfo->rx_fifosize = RX_BUF_SIZE;
+2 -2
View File
@@ -3462,7 +3462,7 @@ set_serial_info(struct e100_serial *info,
info->type = new_serial.type; info->type = new_serial.type;
info->close_delay = new_serial.close_delay; info->close_delay = new_serial.close_delay;
info->closing_wait = new_serial.closing_wait; info->closing_wait = new_serial.closing_wait;
info->port.tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; info->port.low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
check_and_exit: check_and_exit:
if (info->flags & ASYNC_INITIALIZED) { if (info->flags & ASYNC_INITIALIZED) {
@@ -4106,7 +4106,7 @@ rs_open(struct tty_struct *tty, struct file * filp)
tty->driver_data = info; tty->driver_data = info;
info->port.tty = tty; info->port.tty = tty;
tty->low_latency = !!(info->flags & ASYNC_LOW_LATENCY); info->port.low_latency = !!(info->flags & ASYNC_LOW_LATENCY);
/* /*
* If the port is in the middle of closing, bail out now * If the port is in the middle of closing, bail out now
+1 -1
View File
@@ -615,7 +615,7 @@ static int ifx_port_activate(struct tty_port *port, struct tty_struct *tty)
tty->driver_data = ifx_dev; tty->driver_data = ifx_dev;
/* allows flip string push from int context */ /* allows flip string push from int context */
tty->low_latency = 1; port->low_latency = 1;
/* set flag to allows data transfer */ /* set flag to allows data transfer */
set_bit(IFX_SPI_STATE_IO_AVAILABLE, &ifx_dev->flags); set_bit(IFX_SPI_STATE_IO_AVAILABLE, &ifx_dev->flags);
+1 -1
View File
@@ -1000,7 +1000,7 @@ ioc3_change_speed(struct uart_port *the_port,
the_port->ignore_status_mask = N_ALL_INPUT; the_port->ignore_status_mask = N_ALL_INPUT;
state->port.tty->low_latency = 1; state->port.low_latency = 1;
if (iflag & IGNPAR) if (iflag & IGNPAR)
the_port->ignore_status_mask &= ~(N_PARITY_ERROR the_port->ignore_status_mask &= ~(N_PARITY_ERROR
+1 -1
View File
@@ -1740,7 +1740,7 @@ ioc4_change_speed(struct uart_port *the_port,
the_port->ignore_status_mask = N_ALL_INPUT; the_port->ignore_status_mask = N_ALL_INPUT;
state->port.tty->low_latency = 1; state->port.low_latency = 1;
if (iflag & IGNPAR) if (iflag & IGNPAR)
the_port->ignore_status_mask &= ~(N_PARITY_ERROR the_port->ignore_status_mask &= ~(N_PARITY_ERROR
+1 -1
View File
@@ -530,7 +530,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
MAX3100_STATUS_OE; MAX3100_STATUS_OE;
/* we are sending char from a workqueue so enable */ /* we are sending char from a workqueue so enable */
s->port.state->port.tty->low_latency = 1; s->port.state->port.low_latency = 1;
if (s->poll_time > 0) if (s->poll_time > 0)
del_timer_sync(&s->timer); del_timer_sync(&s->timer);
+1 -1
View File
@@ -970,7 +970,7 @@ static int mpsc_rx_intr(struct mpsc_port_info *pi)
#endif #endif
/* Following use of tty struct directly is deprecated */ /* Following use of tty struct directly is deprecated */
if (tty_buffer_request_room(port, bytes_in) < bytes_in) { if (tty_buffer_request_room(port, bytes_in) < bytes_in) {
if (tty->low_latency) if (port->low_latency)
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
/* /*
* If this failed then we will throw away the bytes * If this failed then we will throw away the bytes

Some files were not shown because too many files have changed in this diff Show More