diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-09-12 07:02:26 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-12 07:02:26 -0400 |
commit | ddd559b13f6d2fe3ad68c4b3f5235fd3c2eae4e3 (patch) | |
tree | d827bca3fc825a0ac33efbcd493713be40fcc812 /drivers/char/tty_ldisc.c | |
parent | cf7a2b4fb6a9b86779930a0a123b0df41aa9208f (diff) | |
parent | f17a1f06d2fa93f4825be572622eb02c4894db4e (diff) |
Merge branch 'devel-stable' into devel
Conflicts:
MAINTAINERS
arch/arm/mm/fault.c
Diffstat (limited to 'drivers/char/tty_ldisc.c')
-rw-r--r-- | drivers/char/tty_ldisc.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c index 913aa8d3f1c5..acd76b767d4c 100644 --- a/drivers/char/tty_ldisc.c +++ b/drivers/char/tty_ldisc.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/proc_fs.h> | 21 | #include <linux/proc_fs.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/smp_lock.h> | ||
25 | #include <linux/device.h> | 24 | #include <linux/device.h> |
26 | #include <linux/wait.h> | 25 | #include <linux/wait.h> |
27 | #include <linux/bitops.h> | 26 | #include <linux/bitops.h> |
@@ -791,17 +790,20 @@ void tty_ldisc_hangup(struct tty_struct *tty) | |||
791 | * N_TTY. | 790 | * N_TTY. |
792 | */ | 791 | */ |
793 | if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { | 792 | if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { |
794 | /* Avoid racing set_ldisc */ | 793 | /* Avoid racing set_ldisc or tty_ldisc_release */ |
795 | mutex_lock(&tty->ldisc_mutex); | 794 | mutex_lock(&tty->ldisc_mutex); |
796 | /* Switch back to N_TTY */ | 795 | if (tty->ldisc) { /* Not yet closed */ |
797 | tty_ldisc_halt(tty); | 796 | /* Switch back to N_TTY */ |
798 | tty_ldisc_wait_idle(tty); | 797 | tty_ldisc_halt(tty); |
799 | tty_ldisc_reinit(tty); | 798 | tty_ldisc_wait_idle(tty); |
800 | /* At this point we have a closed ldisc and we want to | 799 | tty_ldisc_reinit(tty); |
801 | reopen it. We could defer this to the next open but | 800 | /* At this point we have a closed ldisc and we want to |
802 | it means auditing a lot of other paths so this is a FIXME */ | 801 | reopen it. We could defer this to the next open but |
803 | WARN_ON(tty_ldisc_open(tty, tty->ldisc)); | 802 | it means auditing a lot of other paths so this is |
804 | tty_ldisc_enable(tty); | 803 | a FIXME */ |
804 | WARN_ON(tty_ldisc_open(tty, tty->ldisc)); | ||
805 | tty_ldisc_enable(tty); | ||
806 | } | ||
805 | mutex_unlock(&tty->ldisc_mutex); | 807 | mutex_unlock(&tty->ldisc_mutex); |
806 | tty_reset_termios(tty); | 808 | tty_reset_termios(tty); |
807 | } | 809 | } |
@@ -866,6 +868,7 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty) | |||
866 | 868 | ||
867 | tty_ldisc_wait_idle(tty); | 869 | tty_ldisc_wait_idle(tty); |
868 | 870 | ||
871 | mutex_lock(&tty->ldisc_mutex); | ||
869 | /* | 872 | /* |
870 | * Now kill off the ldisc | 873 | * Now kill off the ldisc |
871 | */ | 874 | */ |
@@ -876,6 +879,7 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty) | |||
876 | 879 | ||
877 | /* Ensure the next open requests the N_TTY ldisc */ | 880 | /* Ensure the next open requests the N_TTY ldisc */ |
878 | tty_set_termios_ldisc(tty, N_TTY); | 881 | tty_set_termios_ldisc(tty, N_TTY); |
882 | mutex_unlock(&tty->ldisc_mutex); | ||
879 | 883 | ||
880 | /* This will need doing differently if we need to lock */ | 884 | /* This will need doing differently if we need to lock */ |
881 | if (o_tty) | 885 | if (o_tty) |