From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Woodhouse <dwmw2@infradead.org>,
Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Correctly flush 8250 buffers, notify ldisc of line status changes.
Date: Tue, 9 Nov 2004 13:28:10 +0000 [thread overview]
Message-ID: <20041109132810.A15570@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1099998926.15462.21.camel@localhost.localdomain>; from alan@lxorguk.ukuu.org.uk on Tue, Nov 09, 2004 at 11:15:30AM +0000
On Tue, Nov 09, 2004 at 11:15:30AM +0000, Alan Cox wrote:
> On Maw, 2004-11-09 at 11:07, David Woodhouse wrote:
> > + * tty_status_change - notify of line status changes
> > + * @tty: terminal
> > + *
> > + * Helper for informing the line discipline that the modem
> > + * status lines may have changed.
> > + */
> > +
> > +void tty_status_changed(struct tty_struct *tty)
> > +{
> > + struct tty_ldisc *ld = tty_ldisc_ref(tty);
> > + if(ld) {
> > + if(ld->status_changed)
> > + ld->status_changed(tty);
> > + tty_ldisc_deref(ld);
> > + }
> > +}
> > +
>
> This is the wrong way to do it. I've been trying this and discarded it.
> The problem is that data arrival is asynchronous to the event which
> means you've not got a clue how to combine the status change and the
> data stream. This in itself makes the whole feature useless.
The status change and character receive are asynchronous with respect
to each other anyway. Consider the case where the serial port says
"we have characters waiting" - we receive a FIFO full of characters.
It then says that the modem status has changed.
You don't actually know when the modem status changed. It may have
changed before any of these characters were received because character
receiption is is highest priority.
Even if you poll the MSR register after you receive every FIFO character,
you still don't know whether the modem status changed before or after
that character was received.
Therefore, anything which relies on knowing precisely when the modem
status changed in the character stream is unfortunately broken by the
limitations of 8250-based hardware.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
next prev parent reply other threads:[~2004-11-09 13:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-05 13:06 [PATCH] Correctly flush 8250 buffers, notify ldisc of line status changes David Woodhouse
2004-11-05 13:08 ` David Woodhouse
2004-11-09 9:22 ` Andrew Morton
2004-11-09 11:07 ` David Woodhouse
2004-11-09 11:15 ` Alan Cox
2004-11-09 13:28 ` Russell King [this message]
2004-11-09 13:17 ` Alan Cox
2004-11-09 14:39 ` David Woodhouse
2004-11-09 13:49 ` Alan Cox
2004-11-09 14:47 ` Russell King
2004-11-09 14:47 ` Alan Cox
2004-11-13 18:10 ` Russell King
2004-11-13 20:52 ` Alan Cox
2004-11-13 22:40 ` Nicolas Pitre
2004-11-09 14:39 ` David Woodhouse
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=20041109132810.A15570@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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