linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* calling context when writing to tty_driver
@ 2002-10-01 10:37 Martin Diehl
  2002-10-01 11:13 ` David McIlwraith
  2002-10-01 18:34 ` Greg KH
  0 siblings, 2 replies; 11+ messages in thread
From: Martin Diehl @ 2002-10-01 10:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg KH


Hi,

just hitting another "sleeping on semaphore from illegal context" issue
with 2.5.39. Happened on down() in either usbserial->write_room() or
usbserial->write(), when invoked from bh context.

Some grepping reveals no documentation of calling context requirements
for those driver calls and existing serial code seems to be happy with bh
context. Therefore I'm wondering whether it is permitted to call from
don't-sleep context?

Since write_room() is usually called immediately before write()'ing stuff
to the driver it would be a good idea to keep them both callable from bh,
IMHO. For example tty_ldisc->write_wakeup() might probably want to issue
write_room() followed by write().

Currently, usbserial calls write_wakeup() from bh (on OUT urb completion)
but needs process context for write_room() and write(). My impression is
the whole point of write_room() is to find out how many data can be
accepted by the write() - if write() would be allowed to sleep it could
just block to deal with any amount of data.

TIA for any insight.

Martin


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

end of thread, other threads:[~2002-10-03 21:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-01 10:37 calling context when writing to tty_driver Martin Diehl
2002-10-01 11:13 ` David McIlwraith
2002-10-01 11:28   ` Martin Diehl
2002-10-01 11:32     ` David McIlwraith
2002-10-01 18:34 ` Greg KH
2002-10-01 19:30   ` Russell King
2002-10-01 21:10   ` Martin Diehl
2002-10-03  6:52     ` Greg KH
2002-10-03  9:51       ` Paul Mackerras
2002-10-03 21:36         ` Martin Diehl
2002-10-01 23:20   ` Paul Mackerras

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).