diff options
-rw-r--r-- | drivers/tty/n_tty.c | 4 | ||||
-rw-r--r-- | drivers/tty/pty.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index d521058ee55a..cd725cc6e21e 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -351,13 +351,13 @@ static void n_tty_packet_mode_flush(struct tty_struct *tty) | |||
351 | { | 351 | { |
352 | unsigned long flags; | 352 | unsigned long flags; |
353 | 353 | ||
354 | spin_lock_irqsave(&tty->ctrl_lock, flags); | ||
355 | if (tty->link->packet) { | 354 | if (tty->link->packet) { |
355 | spin_lock_irqsave(&tty->ctrl_lock, flags); | ||
356 | tty->ctrl_status |= TIOCPKT_FLUSHREAD; | 356 | tty->ctrl_status |= TIOCPKT_FLUSHREAD; |
357 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
357 | if (waitqueue_active(&tty->link->read_wait)) | 358 | if (waitqueue_active(&tty->link->read_wait)) |
358 | wake_up_interruptible(&tty->link->read_wait); | 359 | wake_up_interruptible(&tty->link->read_wait); |
359 | } | 360 | } |
360 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
361 | } | 361 | } |
362 | 362 | ||
363 | /** | 363 | /** |
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 29b5eeb01856..e554393d5551 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c | |||
@@ -339,26 +339,26 @@ static void pty_start(struct tty_struct *tty) | |||
339 | { | 339 | { |
340 | unsigned long flags; | 340 | unsigned long flags; |
341 | 341 | ||
342 | spin_lock_irqsave(&tty->ctrl_lock, flags); | ||
343 | if (tty->link && tty->link->packet) { | 342 | if (tty->link && tty->link->packet) { |
343 | spin_lock_irqsave(&tty->ctrl_lock, flags); | ||
344 | tty->ctrl_status &= ~TIOCPKT_STOP; | 344 | tty->ctrl_status &= ~TIOCPKT_STOP; |
345 | tty->ctrl_status |= TIOCPKT_START; | 345 | tty->ctrl_status |= TIOCPKT_START; |
346 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
346 | wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); | 347 | wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); |
347 | } | 348 | } |
348 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
349 | } | 349 | } |
350 | 350 | ||
351 | static void pty_stop(struct tty_struct *tty) | 351 | static void pty_stop(struct tty_struct *tty) |
352 | { | 352 | { |
353 | unsigned long flags; | 353 | unsigned long flags; |
354 | 354 | ||
355 | spin_lock_irqsave(&tty->ctrl_lock, flags); | ||
356 | if (tty->link && tty->link->packet) { | 355 | if (tty->link && tty->link->packet) { |
356 | spin_lock_irqsave(&tty->ctrl_lock, flags); | ||
357 | tty->ctrl_status &= ~TIOCPKT_START; | 357 | tty->ctrl_status &= ~TIOCPKT_START; |
358 | tty->ctrl_status |= TIOCPKT_STOP; | 358 | tty->ctrl_status |= TIOCPKT_STOP; |
359 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
359 | wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); | 360 | wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); |
360 | } | 361 | } |
361 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
362 | } | 362 | } |
363 | 363 | ||
364 | /** | 364 | /** |