aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/istallion.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-06-01 16:53:05 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 16:47:43 -0400
commitbe1bc2889a4db4961ef69f47fb471ecae9f23ade (patch)
treefd6d5e46e69efd9d66e6baa184988461f608f49a /drivers/char/istallion.c
parent4e608671674b62e97166f903830d5553e37970e8 (diff)
tty: introduce wait_event_interruptible_tty
Calling wait_event_interruptible implicitly releases the BKL when it sleeps, but we need to do this explcitly when we have converted it to a mutex. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/istallion.c')
-rw-r--r--drivers/char/istallion.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 5e9a81d8ebcf..be28391adb79 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -954,7 +954,7 @@ static int stli_rawopen(struct stlibrd *brdp, struct stliport *portp, unsigned l
954 * order of opens and closes may not be preserved across shared 954 * order of opens and closes may not be preserved across shared
955 * memory, so we must wait until it is complete. 955 * memory, so we must wait until it is complete.
956 */ 956 */
957 wait_event_interruptible(portp->raw_wait, 957 wait_event_interruptible_tty(portp->raw_wait,
958 !test_bit(ST_CLOSING, &portp->state)); 958 !test_bit(ST_CLOSING, &portp->state));
959 if (signal_pending(current)) { 959 if (signal_pending(current)) {
960 return -ERESTARTSYS; 960 return -ERESTARTSYS;
@@ -989,7 +989,7 @@ static int stli_rawopen(struct stlibrd *brdp, struct stliport *portp, unsigned l
989 set_bit(ST_OPENING, &portp->state); 989 set_bit(ST_OPENING, &portp->state);
990 spin_unlock_irqrestore(&brd_lock, flags); 990 spin_unlock_irqrestore(&brd_lock, flags);
991 991
992 wait_event_interruptible(portp->raw_wait, 992 wait_event_interruptible_tty(portp->raw_wait,
993 !test_bit(ST_OPENING, &portp->state)); 993 !test_bit(ST_OPENING, &portp->state));
994 if (signal_pending(current)) 994 if (signal_pending(current))
995 rc = -ERESTARTSYS; 995 rc = -ERESTARTSYS;
@@ -1020,7 +1020,7 @@ static int stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned
1020 * occurs on this port. 1020 * occurs on this port.
1021 */ 1021 */
1022 if (wait) { 1022 if (wait) {
1023 wait_event_interruptible(portp->raw_wait, 1023 wait_event_interruptible_tty(portp->raw_wait,
1024 !test_bit(ST_CLOSING, &portp->state)); 1024 !test_bit(ST_CLOSING, &portp->state));
1025 if (signal_pending(current)) { 1025 if (signal_pending(current)) {
1026 return -ERESTARTSYS; 1026 return -ERESTARTSYS;
@@ -1052,7 +1052,7 @@ static int stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned
1052 * to come back. 1052 * to come back.
1053 */ 1053 */
1054 rc = 0; 1054 rc = 0;
1055 wait_event_interruptible(portp->raw_wait, 1055 wait_event_interruptible_tty(portp->raw_wait,
1056 !test_bit(ST_CLOSING, &portp->state)); 1056 !test_bit(ST_CLOSING, &portp->state));
1057 if (signal_pending(current)) 1057 if (signal_pending(current))
1058 rc = -ERESTARTSYS; 1058 rc = -ERESTARTSYS;
@@ -1073,6 +1073,10 @@ static int stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned
1073 1073
1074static int stli_cmdwait(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback) 1074static int stli_cmdwait(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback)
1075{ 1075{
1076 /*
1077 * no need for wait_event_tty because clearing ST_CMDING cannot block
1078 * on BTM
1079 */
1076 wait_event_interruptible(portp->raw_wait, 1080 wait_event_interruptible(portp->raw_wait,
1077 !test_bit(ST_CMDING, &portp->state)); 1081 !test_bit(ST_CMDING, &portp->state));
1078 if (signal_pending(current)) 1082 if (signal_pending(current))