aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ip2
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-06-01 16:53:10 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 16:47:44 -0400
commite142a31da34b42458e10026b554e66127739cf23 (patch)
tree1f65a42cd559116223e1fa1db7631cd449c73968 /drivers/char/ip2
parentb07471fa51358ce64cc25e1501544502362e4404 (diff)
tty: release BTM while sleeping in block_til_ready
Most tty drivers may block while opening a device. Since this possibly depends on another thread closing it first and both threads may need the BTM, we need to release it here. 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/ip2')
-rw-r--r--drivers/char/ip2/ip2main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 911e1da6def2..07f3ea38b582 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -1486,7 +1486,9 @@ ip2_open( PTTY tty, struct file *pFile )
1486 1486
1487 if ( tty_hung_up_p(pFile) || ( pCh->flags & ASYNC_CLOSING )) { 1487 if ( tty_hung_up_p(pFile) || ( pCh->flags & ASYNC_CLOSING )) {
1488 if ( pCh->flags & ASYNC_CLOSING ) { 1488 if ( pCh->flags & ASYNC_CLOSING ) {
1489 tty_unlock();
1489 schedule(); 1490 schedule();
1491 tty_lock();
1490 } 1492 }
1491 if ( tty_hung_up_p(pFile) ) { 1493 if ( tty_hung_up_p(pFile) ) {
1492 set_current_state( TASK_RUNNING ); 1494 set_current_state( TASK_RUNNING );
@@ -1548,7 +1550,9 @@ ip2_open( PTTY tty, struct file *pFile )
1548 rc = (( pCh->flags & ASYNC_HUP_NOTIFY ) ? -EAGAIN : -ERESTARTSYS); 1550 rc = (( pCh->flags & ASYNC_HUP_NOTIFY ) ? -EAGAIN : -ERESTARTSYS);
1549 break; 1551 break;
1550 } 1552 }
1553 tty_unlock();
1551 schedule(); 1554 schedule();
1555 tty_lock();
1552 } 1556 }
1553 set_current_state( TASK_RUNNING ); 1557 set_current_state( TASK_RUNNING );
1554 remove_wait_queue(&pCh->open_wait, &wait); 1558 remove_wait_queue(&pCh->open_wait, &wait);