aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tty_port.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index 3ef644a2e517..43a190738fee 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -122,8 +122,10 @@ void tty_port_hangup(struct tty_port *port)
122 spin_lock_irqsave(&port->lock, flags); 122 spin_lock_irqsave(&port->lock, flags);
123 port->count = 0; 123 port->count = 0;
124 port->flags &= ~ASYNC_NORMAL_ACTIVE; 124 port->flags &= ~ASYNC_NORMAL_ACTIVE;
125 if (port->tty) 125 if (port->tty) {
126 set_bit(TTY_IO_ERROR, &port->tty->flags);
126 tty_kref_put(port->tty); 127 tty_kref_put(port->tty);
128 }
127 port->tty = NULL; 129 port->tty = NULL;
128 spin_unlock_irqrestore(&port->lock, flags); 130 spin_unlock_irqrestore(&port->lock, flags);
129 wake_up_interruptible(&port->open_wait); 131 wake_up_interruptible(&port->open_wait);
@@ -383,6 +385,7 @@ void tty_port_close(struct tty_port *port, struct tty_struct *tty,
383 if (tty_port_close_start(port, tty, filp) == 0) 385 if (tty_port_close_start(port, tty, filp) == 0)
384 return; 386 return;
385 tty_port_shutdown(port); 387 tty_port_shutdown(port);
388 set_bit(TTY_IO_ERROR, &tty->flags);
386 tty_port_close_end(port, tty); 389 tty_port_close_end(port, tty);
387 tty_port_tty_set(port, NULL); 390 tty_port_tty_set(port, NULL);
388} 391}
@@ -414,6 +417,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
414 } 417 }
415 } 418 }
416 set_bit(ASYNCB_INITIALIZED, &port->flags); 419 set_bit(ASYNCB_INITIALIZED, &port->flags);
420 clear_bit(TTY_IO_ERROR, &tty->flags);
417 } 421 }
418 mutex_unlock(&port->mutex); 422 mutex_unlock(&port->mutex);
419 return tty_port_block_til_ready(port, tty, filp); 423 return tty_port_block_til_ready(port, tty, filp);