From 08ddc3193c8fda254c60730a9572ff3162a8a233 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 4 Feb 2008 22:27:52 -0800 Subject: [PATCH] --- yaml --- r: 83004 b: refs/heads/master c: c8c6bfa39d6bd7347f43937c8767ae145b61bcb4 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/serial/serial_core.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index fe224c64eb51..d9300fbfc394 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9d778a69370cc1b643b13648df971c83ff5654ef +refs/heads/master: c8c6bfa39d6bd7347f43937c8767ae145b61bcb4 diff --git a/trunk/drivers/serial/serial_core.c b/trunk/drivers/serial/serial_core.c index 2554d2fa6542..304fe32eb066 100644 --- a/trunk/drivers/serial/serial_core.c +++ b/trunk/drivers/serial/serial_core.c @@ -1977,6 +1977,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) if (state->info && state->info->flags & UIF_INITIALIZED) { const struct uart_ops *ops = port->ops; + int tries; state->info->flags = (state->info->flags & ~UIF_INITIALIZED) | UIF_SUSPENDED; @@ -1990,9 +1991,14 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) /* * Wait for the transmitter to empty. */ - while (!ops->tx_empty(port)) { + for (tries = 3; !ops->tx_empty(port) && tries; tries--) { msleep(10); } + if (!tries) + printk(KERN_ERR "%s%s%s%d: Unable to drain transmitter\n", + port->dev ? port->dev->bus_id : "", + port->dev ? ": " : "", + drv->dev_name, port->line); ops->shutdown(port); }