diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-06-01 16:53:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:43 -0400 |
commit | 203652192634c1fce5e79df0a8ff2fabfaefd3ab (patch) | |
tree | 9c2ee78c04b0750220fa34e7adc541c16bf21e90 /drivers/serial/68360serial.c | |
parent | 60af22d2ed490554cc92c8d0fed0b5b9cf687568 (diff) |
tty: untangle locking of wait_until_sent
Some wait_until_sent versions require the big
tty mutex, others don't and some callers of
wait_until_sent already hold it while other don't.
That leads to recursive use of the BTM in these
functions, which we're trying to get rid of.
This turns all cleans up the locking there so
that the driver's wait_until_sent function
never takes the BTM itself if it is already
called with that lock held.
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/serial/68360serial.c')
-rw-r--r-- | drivers/serial/68360serial.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index 16f5f2fab032..edcf1cc089d1 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c | |||
@@ -1705,7 +1705,6 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout) | |||
1705 | printk("jiff=%lu...", jiffies); | 1705 | printk("jiff=%lu...", jiffies); |
1706 | #endif | 1706 | #endif |
1707 | 1707 | ||
1708 | tty_lock_nested(); /* always held already since we come from ->close */ | ||
1709 | /* We go through the loop at least once because we can't tell | 1708 | /* We go through the loop at least once because we can't tell |
1710 | * exactly when the last character exits the shifter. There can | 1709 | * exactly when the last character exits the shifter. There can |
1711 | * be at least two characters waiting to be sent after the buffers | 1710 | * be at least two characters waiting to be sent after the buffers |
@@ -1734,7 +1733,6 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout) | |||
1734 | bdp--; | 1733 | bdp--; |
1735 | } while (bdp->status & BD_SC_READY); | 1734 | } while (bdp->status & BD_SC_READY); |
1736 | current->state = TASK_RUNNING; | 1735 | current->state = TASK_RUNNING; |
1737 | tty_unlock(); | ||
1738 | #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT | 1736 | #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT |
1739 | printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); | 1737 | printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); |
1740 | #endif | 1738 | #endif |