Commit 58561763 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk/linux-2.6-serial

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 757daad0 bb3ddc31
...@@ -584,8 +584,10 @@ static int uart_get_info(struct uart_state *state, ...@@ -584,8 +584,10 @@ static int uart_get_info(struct uart_state *state,
tmp.flags = port->flags; tmp.flags = port->flags;
tmp.xmit_fifo_size = port->fifosize; tmp.xmit_fifo_size = port->fifosize;
tmp.baud_base = port->uartclk / 16; tmp.baud_base = port->uartclk / 16;
tmp.close_delay = state->close_delay; tmp.close_delay = state->close_delay / 10;
tmp.closing_wait = state->closing_wait; tmp.closing_wait = state->closing_wait == USF_CLOSING_WAIT_NONE ?
ASYNC_CLOSING_WAIT_NONE :
state->closing_wait / 10;
tmp.custom_divisor = port->custom_divisor; tmp.custom_divisor = port->custom_divisor;
tmp.hub6 = port->hub6; tmp.hub6 = port->hub6;
tmp.io_type = port->iotype; tmp.io_type = port->iotype;
...@@ -603,8 +605,8 @@ static int uart_set_info(struct uart_state *state, ...@@ -603,8 +605,8 @@ static int uart_set_info(struct uart_state *state,
struct serial_struct new_serial; struct serial_struct new_serial;
struct uart_port *port = state->port; struct uart_port *port = state->port;
unsigned long new_port; unsigned long new_port;
unsigned int change_irq, change_port, old_flags; unsigned int change_irq, change_port, old_flags, closing_wait;
unsigned int old_custom_divisor; unsigned int old_custom_divisor, close_delay;
int retval = 0; int retval = 0;
if (copy_from_user(&new_serial, newinfo, sizeof(new_serial))) if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
...@@ -615,6 +617,9 @@ static int uart_set_info(struct uart_state *state, ...@@ -615,6 +617,9 @@ static int uart_set_info(struct uart_state *state,
new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET; new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET;
new_serial.irq = irq_canonicalize(new_serial.irq); new_serial.irq = irq_canonicalize(new_serial.irq);
close_delay = new_serial.close_delay * 10;
closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
USF_CLOSING_WAIT_NONE : new_serial.closing_wait * 10;
/* /*
* This semaphore protects state->count. It is also * This semaphore protects state->count. It is also
...@@ -646,8 +651,8 @@ static int uart_set_info(struct uart_state *state, ...@@ -646,8 +651,8 @@ static int uart_set_info(struct uart_state *state,
retval = -EPERM; retval = -EPERM;
if (change_irq || change_port || if (change_irq || change_port ||
(new_serial.baud_base != port->uartclk / 16) || (new_serial.baud_base != port->uartclk / 16) ||
(new_serial.close_delay != state->close_delay) || (close_delay != state->close_delay) ||
(new_serial.closing_wait != state->closing_wait) || (closing_wait != state->closing_wait) ||
(new_serial.xmit_fifo_size != port->fifosize) || (new_serial.xmit_fifo_size != port->fifosize) ||
(((new_serial.flags ^ old_flags) & ~UPF_USR_MASK) != 0)) (((new_serial.flags ^ old_flags) & ~UPF_USR_MASK) != 0))
goto exit; goto exit;
...@@ -751,8 +756,8 @@ static int uart_set_info(struct uart_state *state, ...@@ -751,8 +756,8 @@ static int uart_set_info(struct uart_state *state,
port->flags = (port->flags & ~UPF_CHANGE_MASK) | port->flags = (port->flags & ~UPF_CHANGE_MASK) |
(new_serial.flags & UPF_CHANGE_MASK); (new_serial.flags & UPF_CHANGE_MASK);
port->custom_divisor = new_serial.custom_divisor; port->custom_divisor = new_serial.custom_divisor;
state->close_delay = new_serial.close_delay * HZ / 100; state->close_delay = close_delay;
state->closing_wait = new_serial.closing_wait * HZ / 100; state->closing_wait = closing_wait;
port->fifosize = new_serial.xmit_fifo_size; port->fifosize = new_serial.xmit_fifo_size;
if (state->info->tty) if (state->info->tty)
state->info->tty->low_latency = state->info->tty->low_latency =
...@@ -1191,7 +1196,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp) ...@@ -1191,7 +1196,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
tty->closing = 1; tty->closing = 1;
if (state->closing_wait != USF_CLOSING_WAIT_NONE) if (state->closing_wait != USF_CLOSING_WAIT_NONE)
tty_wait_until_sent(tty, state->closing_wait); tty_wait_until_sent(tty, msecs_to_jiffies(state->closing_wait));
/* /*
* At this point, we stop accepting input. To do this, we * At this point, we stop accepting input. To do this, we
...@@ -1219,9 +1224,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp) ...@@ -1219,9 +1224,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
state->info->tty = NULL; state->info->tty = NULL;
if (state->info->blocked_open) { if (state->info->blocked_open) {
if (state->close_delay) { if (state->close_delay)
msleep_interruptible(jiffies_to_msecs(state->close_delay)); msleep_interruptible(state->close_delay);
}
} else if (!uart_console(port)) { } else if (!uart_console(port)) {
uart_change_pm(state, 3); uart_change_pm(state, 3);
} }
...@@ -2082,8 +2086,8 @@ int uart_register_driver(struct uart_driver *drv) ...@@ -2082,8 +2086,8 @@ int uart_register_driver(struct uart_driver *drv)
for (i = 0; i < drv->nr; i++) { for (i = 0; i < drv->nr; i++) {
struct uart_state *state = drv->state + i; struct uart_state *state = drv->state + i;
state->close_delay = 5 * HZ / 10; state->close_delay = 500; /* .5 seconds */
state->closing_wait = 30 * HZ; state->closing_wait = 30000; /* 30 seconds */
init_MUTEX(&state->sem); init_MUTEX(&state->sem);
} }
......
...@@ -91,12 +91,15 @@ ...@@ -91,12 +91,15 @@
/* MPC52xx type numbers */ /* MPC52xx type numbers */
#define PORT_MPC52xx 59 #define PORT_MPC52xx 59
/*IBM icom*/ /* IBM icom */
#define PORT_ICOM 60 #define PORT_ICOM 60
/* Samsung S3C2440 SoC */ /* Samsung S3C2440 SoC */
#define PORT_S3C2440 61 #define PORT_S3C2440 61
/* Motorola i.MX SoC */
#define PORT_IMX 62
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
...@@ -241,11 +244,11 @@ struct uart_port { ...@@ -241,11 +244,11 @@ struct uart_port {
* within. * within.
*/ */
struct uart_state { struct uart_state {
unsigned int close_delay; unsigned int close_delay; /* msec */
unsigned int closing_wait; unsigned int closing_wait; /* msec */
#define USF_CLOSING_WAIT_INF (0) #define USF_CLOSING_WAIT_INF (0)
#define USF_CLOSING_WAIT_NONE (65535) #define USF_CLOSING_WAIT_NONE (~0U)
int count; int count;
int pm_state; int pm_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment