aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2011-11-09 15:33:45 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-15 18:58:58 -0500
commit4cb0fbfdc81f29a414583bd05a9e324f8f19984d (patch)
tree147b605d11f2026f055bcc486c42f1957557c83f /drivers/tty
parentb54bf3b24908cd4f6a1d24276f795cfbccba5a3f (diff)
TTY: serial, switch closing_wait and close_delay to jiffies
As the tty_port helpers think closing_wait and close_delay are in jiffies and we want to use the helpers (next patches), we have to switch the closing_wait and close_delay from ms to jiffies now. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/serial_core.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 8d825a36c84..2b1ee7cc4f8 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -659,10 +659,10 @@ static int uart_get_info(struct uart_state *state,
659 tmp.flags = uport->flags; 659 tmp.flags = uport->flags;
660 tmp.xmit_fifo_size = uport->fifosize; 660 tmp.xmit_fifo_size = uport->fifosize;
661 tmp.baud_base = uport->uartclk / 16; 661 tmp.baud_base = uport->uartclk / 16;
662 tmp.close_delay = port->close_delay / 10; 662 tmp.close_delay = jiffies_to_msecs(port->close_delay) / 10;
663 tmp.closing_wait = port->closing_wait == ASYNC_CLOSING_WAIT_NONE ? 663 tmp.closing_wait = port->closing_wait == ASYNC_CLOSING_WAIT_NONE ?
664 ASYNC_CLOSING_WAIT_NONE : 664 ASYNC_CLOSING_WAIT_NONE :
665 port->closing_wait / 10; 665 jiffies_to_msecs(port->closing_wait) / 10;
666 tmp.custom_divisor = uport->custom_divisor; 666 tmp.custom_divisor = uport->custom_divisor;
667 tmp.hub6 = uport->hub6; 667 tmp.hub6 = uport->hub6;
668 tmp.io_type = uport->iotype; 668 tmp.io_type = uport->iotype;
@@ -696,9 +696,10 @@ static int uart_set_info(struct tty_struct *tty, struct uart_state *state,
696 new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET; 696 new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET;
697 697
698 new_serial.irq = irq_canonicalize(new_serial.irq); 698 new_serial.irq = irq_canonicalize(new_serial.irq);
699 close_delay = new_serial.close_delay * 10; 699 close_delay = msecs_to_jiffies(new_serial.close_delay * 10);
700 closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ? 700 closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
701 ASYNC_CLOSING_WAIT_NONE : new_serial.closing_wait * 10; 701 ASYNC_CLOSING_WAIT_NONE :
702 msecs_to_jiffies(new_serial.closing_wait * 10);
702 703
703 /* 704 /*
704 * This semaphore protects port->count. It is also 705 * This semaphore protects port->count. It is also
@@ -1305,8 +1306,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
1305 spin_unlock_irqrestore(&port->lock, flags); 1306 spin_unlock_irqrestore(&port->lock, flags);
1306 1307
1307 if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) 1308 if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
1308 tty_wait_until_sent_from_close(tty, 1309 tty_wait_until_sent_from_close(tty, port->closing_wait);
1309 msecs_to_jiffies(port->closing_wait));
1310 1310
1311 /* 1311 /*
1312 * At this point, we stop accepting input. To do this, we 1312 * At this point, we stop accepting input. To do this, we
@@ -1338,7 +1338,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
1338 if (port->blocked_open) { 1338 if (port->blocked_open) {
1339 spin_unlock_irqrestore(&port->lock, flags); 1339 spin_unlock_irqrestore(&port->lock, flags);
1340 if (port->close_delay) 1340 if (port->close_delay)
1341 msleep_interruptible(port->close_delay); 1341 msleep_interruptible(
1342 jiffies_to_msecs(port->close_delay));
1342 spin_lock_irqsave(&port->lock, flags); 1343 spin_lock_irqsave(&port->lock, flags);
1343 } else if (!uart_console(uport)) { 1344 } else if (!uart_console(uport)) {
1344 spin_unlock_irqrestore(&port->lock, flags); 1345 spin_unlock_irqrestore(&port->lock, flags);
@@ -2276,8 +2277,8 @@ int uart_register_driver(struct uart_driver *drv)
2276 2277
2277 tty_port_init(port); 2278 tty_port_init(port);
2278 port->ops = &uart_port_ops; 2279 port->ops = &uart_port_ops;
2279 port->close_delay = 500; /* .5 seconds */ 2280 port->close_delay = HZ / 2; /* .5 seconds */
2280 port->closing_wait = 30000; /* 30 seconds */ 2281 port->closing_wait = 30 * HZ;/* 30 seconds */
2281 } 2282 }
2282 2283
2283 retval = tty_register_driver(normal); 2284 retval = tty_register_driver(normal);