|
@@ -1940,6 +1940,9 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
|
|
if (state->info && state->info->flags & UIF_INITIALIZED) {
|
|
if (state->info && state->info->flags & UIF_INITIALIZED) {
|
|
const struct uart_ops *ops = port->ops;
|
|
const struct uart_ops *ops = port->ops;
|
|
|
|
|
|
|
|
+ state->info->flags = (state->info->flags & ~UIF_INITIALIZED)
|
|
|
|
+ | UIF_SUSPENDED;
|
|
|
|
+
|
|
spin_lock_irq(&port->lock);
|
|
spin_lock_irq(&port->lock);
|
|
ops->stop_tx(port);
|
|
ops->stop_tx(port);
|
|
ops->set_mctrl(port, 0);
|
|
ops->set_mctrl(port, 0);
|
|
@@ -2006,7 +2009,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
|
|
console_start(port->cons);
|
|
console_start(port->cons);
|
|
}
|
|
}
|
|
|
|
|
|
- if (state->info && state->info->flags & UIF_INITIALIZED) {
|
|
|
|
|
|
+ if (state->info && state->info->flags & UIF_SUSPENDED) {
|
|
const struct uart_ops *ops = port->ops;
|
|
const struct uart_ops *ops = port->ops;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
@@ -2018,15 +2021,17 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
|
|
ops->set_mctrl(port, port->mctrl);
|
|
ops->set_mctrl(port, port->mctrl);
|
|
ops->start_tx(port);
|
|
ops->start_tx(port);
|
|
spin_unlock_irq(&port->lock);
|
|
spin_unlock_irq(&port->lock);
|
|
|
|
+ state->info->flags |= UIF_INITIALIZED;
|
|
} else {
|
|
} else {
|
|
/*
|
|
/*
|
|
* Failed to resume - maybe hardware went away?
|
|
* Failed to resume - maybe hardware went away?
|
|
* Clear the "initialized" flag so we won't try
|
|
* Clear the "initialized" flag so we won't try
|
|
* to call the low level drivers shutdown method.
|
|
* to call the low level drivers shutdown method.
|
|
*/
|
|
*/
|
|
- state->info->flags &= ~UIF_INITIALIZED;
|
|
|
|
uart_shutdown(state);
|
|
uart_shutdown(state);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ state->info->flags &= ~UIF_SUSPENDED;
|
|
}
|
|
}
|
|
|
|
|
|
mutex_unlock(&state->mutex);
|
|
mutex_unlock(&state->mutex);
|