diff options
Diffstat (limited to 'drivers/char/amiserial.c')
-rw-r--r-- | drivers/char/amiserial.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 1b21a7adeb58..8228e61bb54d 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c | |||
@@ -1528,6 +1528,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) | |||
1528 | { | 1528 | { |
1529 | struct async_struct * info = tty->driver_data; | 1529 | struct async_struct * info = tty->driver_data; |
1530 | unsigned long orig_jiffies, char_time; | 1530 | unsigned long orig_jiffies, char_time; |
1531 | int tty_was_locked = tty_locked(); | ||
1531 | int lsr; | 1532 | int lsr; |
1532 | 1533 | ||
1533 | if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent")) | 1534 | if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent")) |
@@ -1538,7 +1539,12 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) | |||
1538 | 1539 | ||
1539 | orig_jiffies = jiffies; | 1540 | orig_jiffies = jiffies; |
1540 | 1541 | ||
1541 | tty_lock_nested(); /* tty_wait_until_sent is called from lots of places */ | 1542 | /* |
1543 | * tty_wait_until_sent is called from lots of places, | ||
1544 | * with or without the BTM. | ||
1545 | */ | ||
1546 | if (!tty_was_locked) | ||
1547 | tty_lock(); | ||
1542 | /* | 1548 | /* |
1543 | * Set the check interval to be 1/5 of the estimated time to | 1549 | * Set the check interval to be 1/5 of the estimated time to |
1544 | * send a single character, and make it at least 1. The check | 1550 | * send a single character, and make it at least 1. The check |
@@ -1579,7 +1585,8 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) | |||
1579 | break; | 1585 | break; |
1580 | } | 1586 | } |
1581 | __set_current_state(TASK_RUNNING); | 1587 | __set_current_state(TASK_RUNNING); |
1582 | tty_unlock(); | 1588 | if (!tty_was_locked) |
1589 | tty_unlock(); | ||
1583 | #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT | 1590 | #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT |
1584 | printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); | 1591 | printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); |
1585 | #endif | 1592 | #endif |