Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38220
b: refs/heads/master
c: a6b93a9
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Oct 1, 2006
1 parent def2e06 commit ab24a21
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe59d5372ae719ca4550958f1e5bb4dd6eeac9cd
refs/heads/master: a6b93a908508810c5d51dd9b390283345af6f2d9
9 changes: 7 additions & 2 deletions trunk/drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1940,6 +1940,9 @@ 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;

state->info->flags = (state->info->flags & ~UIF_INITIALIZED)
| UIF_SUSPENDED;

spin_lock_irq(&port->lock);
ops->stop_tx(port);
ops->set_mctrl(port, 0);
Expand Down Expand Up @@ -2006,7 +2009,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
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;
int ret;

Expand All @@ -2018,15 +2021,17 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
ops->set_mctrl(port, port->mctrl);
ops->start_tx(port);
spin_unlock_irq(&port->lock);
state->info->flags |= UIF_INITIALIZED;
} else {
/*
* Failed to resume - maybe hardware went away?
* Clear the "initialized" flag so we won't try
* to call the low level drivers shutdown method.
*/
state->info->flags &= ~UIF_INITIALIZED;
uart_shutdown(state);
}

state->info->flags &= ~UIF_SUSPENDED;
}

mutex_unlock(&state->mutex);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/serial_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ struct uart_info {
#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))
#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29))
#define UIF_INITIALIZED ((__force uif_t) (1 << 31))
#define UIF_SUSPENDED ((__force uif_t) (1 << 30))

int blocked_open;

Expand Down

0 comments on commit ab24a21

Please sign in to comment.