aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/crisv10.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-06-01 16:53:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 16:47:43 -0400
commit203652192634c1fce5e79df0a8ff2fabfaefd3ab (patch)
tree9c2ee78c04b0750220fa34e7adc541c16bf21e90 /drivers/serial/crisv10.c
parent60af22d2ed490554cc92c8d0fed0b5b9cf687568 (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/crisv10.c')
-rw-r--r--drivers/serial/crisv10.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 94bfb9f238e1..8e356c5eeae0 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -3935,7 +3935,6 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
3935 * Check R_DMA_CHx_STATUS bit 0-6=number of available bytes in FIFO 3935 * Check R_DMA_CHx_STATUS bit 0-6=number of available bytes in FIFO
3936 * R_DMA_CHx_HWSW bit 31-16=nbr of bytes left in DMA buffer (0=64k) 3936 * R_DMA_CHx_HWSW bit 31-16=nbr of bytes left in DMA buffer (0=64k)
3937 */ 3937 */
3938 tty_lock_nested(); /* locked already when coming from close */
3939 orig_jiffies = jiffies; 3938 orig_jiffies = jiffies;
3940 while (info->xmit.head != info->xmit.tail || /* More in send queue */ 3939 while (info->xmit.head != info->xmit.tail || /* More in send queue */
3941 (*info->ostatusadr & 0x007f) || /* more in FIFO */ 3940 (*info->ostatusadr & 0x007f) || /* more in FIFO */
@@ -3952,7 +3951,6 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
3952 curr_time_usec - info->last_tx_active_usec; 3951 curr_time_usec - info->last_tx_active_usec;
3953 } 3952 }
3954 set_current_state(TASK_RUNNING); 3953 set_current_state(TASK_RUNNING);
3955 tty_unlock();
3956} 3954}
3957 3955
3958/* 3956/*