aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/serial/serial_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 2554d2fa6542..304fe32eb066 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1977,6 +1977,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
1977 1977
1978 if (state->info && state->info->flags & UIF_INITIALIZED) { 1978 if (state->info && state->info->flags & UIF_INITIALIZED) {
1979 const struct uart_ops *ops = port->ops; 1979 const struct uart_ops *ops = port->ops;
1980 int tries;
1980 1981
1981 state->info->flags = (state->info->flags & ~UIF_INITIALIZED) 1982 state->info->flags = (state->info->flags & ~UIF_INITIALIZED)
1982 | UIF_SUSPENDED; 1983 | UIF_SUSPENDED;
@@ -1990,9 +1991,14 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
1990 /* 1991 /*
1991 * Wait for the transmitter to empty. 1992 * Wait for the transmitter to empty.
1992 */ 1993 */
1993 while (!ops->tx_empty(port)) { 1994 for (tries = 3; !ops->tx_empty(port) && tries; tries--) {
1994 msleep(10); 1995 msleep(10);
1995 } 1996 }
1997 if (!tries)
1998 printk(KERN_ERR "%s%s%s%d: Unable to drain transmitter\n",
1999 port->dev ? port->dev->bus_id : "",
2000 port->dev ? ": " : "",
2001 drv->dev_name, port->line);
1996 2002
1997 ops->shutdown(port); 2003 ops->shutdown(port);
1998 } 2004 }