netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ircomm: release tty before sleeping potentially indefintely
@ 2013-03-03 22:35 Sasha Levin
  2013-03-03 22:47 ` David Miller
  0 siblings, 1 reply; 17+ messages in thread
From: Sasha Levin @ 2013-03-03 22:35 UTC (permalink / raw)
  To: samuel; +Cc: davem, gregkh, jslaby, peter, netdev, linux-kernel, Sasha Levin

ircomm_tty_block_til_ready would hold tty lock while blocking. Since the sleep
might take a long time we can prevent other processes from accessing the tty,
causing hung tasks and a dead tty.

Diagnosed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 net/irda/ircomm/ircomm_tty.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 9a5fd3c..7844cb3 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -355,7 +355,9 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
 		IRDA_DEBUG(1, "%s(%d):block_til_ready blocking on %s open_count=%d\n",
 		      __FILE__, __LINE__, tty->driver->name, port->count);
 
+		tty_unlock(tty);
 		schedule();
+		tty_lock(tty);
 	}
 
 	__set_current_state(TASK_RUNNING);
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-03-06  4:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-03 22:35 [PATCH] ircomm: release tty before sleeping potentially indefintely Sasha Levin
2013-03-03 22:47 ` David Miller
2013-03-03 23:17   ` Sasha Levin
2013-03-04  0:31     ` David Miller
2013-03-04  0:04   ` Peter Hurley
2013-03-04  0:33     ` David Miller
2013-03-04  1:06       ` Peter Hurley
2013-03-04  2:36         ` David Miller
2013-03-04  4:24           ` Peter Hurley
2013-03-05 16:09             ` [PATCH 0/4] other ircomm_tty fixes (was Re: [PATCH] ircomm: release tty before sleeping potentially indefintely) Peter Hurley
2013-03-05 16:09               ` [PATCH 1/4] net/irda: Fix port open counts Peter Hurley
2013-03-05 16:09               ` [PATCH 2/4] net/irda: Hold port lock while bumping blocked_open Peter Hurley
2013-03-05 16:09               ` [PATCH 3/4] net/irda: Use barrier to set task state Peter Hurley
2013-03-05 16:09               ` [PATCH 4/4] net/irda: Raise dtr in non-blocking open Peter Hurley
2013-03-06  4:44               ` [PATCH 0/4] other ircomm_tty fixes David Miller
2013-03-04  4:30           ` [PATCH] ircomm: release tty before sleeping potentially indefintely Peter Hurley
2013-03-04  2:23   ` Peter Hurley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).