All of lore.kernel.org
 help / color / mirror / Atom feed
* tty_lock held during transmit wait in close: still unresolved
@ 2011-05-25 23:59 Andreas Bombe
  2011-05-26  7:11 ` Greg KH
  2011-05-26  8:17 ` Alan Cox
  0 siblings, 2 replies; 8+ messages in thread
From: Andreas Bombe @ 2011-05-25 23:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg KH, Alan Cox, Arnd Bergmann

Short reminder/summary: Unlike the BKL, the tty_lock mechanism that
replaced it does not release the lock while sleeping. This causes the
tty_lock to be held for extended periods of time when uart_close()
(running with tty_lock held) tries to flush the transmit buffer but is
unable to do so.

The result is that until the transmit flush completes by the remote end
finally accepting the data or the driver timing out and giving up,
pretty much all tty operations freeze. No programs can be started
and for some reason X freezes for me. From a user viewpoint, the
computer effectively locks up for that time.

After I tracked the issue down to the tty_lock mechanism, I found some
discussion on LKML about that from last November (thread starting here:
http://lkml.kernel.org/r/4CCBCD8E.1020601@billauer.co.il ). However
nothing has come of it, it appears, at least not in the official kernel.

A minimalist way to trigger this issue is with a serial port that has
nothing attached:

stty -F /dev/ttyS0 crtscts
echo >/dev/ttyS0

The echo triggers a 30 second timeout on close while the driver is
trying to flush the newline. Another way is developing an USB device
with a virtual serial port and having it stop (by debugger or
crash/lockup)...

Any ideas on how to progress?

-- 
Andreas Bombe

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

end of thread, other threads:[~2011-05-27 13:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-25 23:59 tty_lock held during transmit wait in close: still unresolved Andreas Bombe
2011-05-26  7:11 ` Greg KH
2011-05-27  0:29   ` Andreas Bombe
2011-05-26  8:17 ` Alan Cox
2011-05-27  0:41   ` Andreas Bombe
2011-05-27 11:38     ` Arnd Bergmann
2011-05-27 12:11     ` Jiri Slaby
2011-05-27 13:53       ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.