archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <>
To: Greg KH <>
Cc: Martin Diehl <>,
Subject: Re: calling context when writing to tty_driver
Date: Thu, 3 Oct 2002 19:51:10 +1000 (EST)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Greg KH writes:

> On Tue, Oct 01, 2002 at 11:10:34PM +0200, Martin Diehl wrote:
> > If we agree serial drivers shouldn't sleep in write_room()/write() my
> > impression is this needs to be addressed somehow, regardless whether
> > usbserial uses the new serial core or not. Anybody tried this with a
> > bluetooth dongle over usbserial?
> I don't know, do we agree that you can't sleep in those functions?  If
> so, I'll look into fixing the usbserial drivers up.

I really think that write and write_room shouldn't be allowed to
sleep.  If they can sleep it will cause much grief for PPP, since the
PPP start_xmit function does get called in softirq context, and in the
common case where you are doing PPP over a serial port, that will
ultimately end up in a call to the serial port's write routine.  If we
can't call the write routine from softirq context, that will mean we
will have to have some sort of helper thread (whether that is keventd
or something else), and that will introduce extra unnecessary latency
when you are using a serial port where the write routine doesn't ever
block (which is all of them except usbserial, at the moment).

I would have thought that the normal tty line discipline would impose
the same requirement.  You type a character, it gets put in a flip
buffer and processed later in softirq context.  That processing says
"we're supposed to echo this character" so it will call the serial
port's write routine - in softirq context, if I am not mistaken.


  reply	other threads:[~2002-10-03  9:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2002-10-03 21:36         ` Martin Diehl
2002-10-01 23:20   ` Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).