From: Martin Buck <mb-kernel0212@gromit.dyndns.org>
To: Stuart MacDonald <stuartm@connecttech.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Race condition in tty_flip_buffer_push/flush_to_ldisc?
Date: Tue, 3 Dec 2002 18:23:10 +0100 [thread overview]
Message-ID: <20021203172310.GA5373@gromit.at.home> (raw)
In-Reply-To: <006601c29ae5$57b28220$294b82ce@connecttech.com>
On Tue, Dec 03, 2002 at 11:02:12AM -0500, Stuart MacDonald wrote:
> What causes the DONT_FLIP bit to be un/set? I don't think your
> situation can occur under normal operation. But ICBW.
n_tty.c seems to do it in read_chan(), i.e. it will happen when the
process reading from the TTY is currently in read(2) while at the same time
new characters arrive on the serial port.
> If you search the lkml archive, recently Ted stated that it's
> acceptable to call the line discpline's receive_buf() routine
> directly, bypassing the flip buffers.
Interesting, that should solve my problem. But then the next question is:
What's the use of the DONT_FLIP bit if it's legal to bypass it by calling
receive_buf() directly?
Also, if somebody enables low_latency using setserial with the standard
serial driver, he can still trigger the race condition. It's not very
likely to happen, but it does happen - I added code to flush_to_ldisc() to
detect concurrent calls and it triggered once during an over-night test.
Thanks,
Martin
prev parent reply other threads:[~2002-12-03 17:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-03 9:33 Martin Buck
2002-12-03 16:02 ` Stuart MacDonald
2002-12-03 17:23 ` Martin Buck [this message]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021203172310.GA5373@gromit.at.home \
--to=mb-kernel0212@gromit.dyndns.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stuartm@connecttech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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
all inboxes | Powered by JetHome®