Re: [PATCH] Correctly flush 8250 buffers, notify ldisc of linestatus changes.
From: Alan Cox
Date: Tue Nov 09 2004 - 09:26:11 EST
>
> 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.
Only to a small degree, and the fifo is configurable in software. RS485
multi
drop users do generally run with FIFO and the message boundaries mean
that the
event accuracy is good enough.
What the callback does is provide a notification *before* the data
arrives, and easily 2mS out which calls a line discipline function that
cannot sleep and cannot viably interact with the data stream.
In addition you've not defined the semantics of that function for
calling back into the tty driver. You tell me "carrier dropped", yet in
that routine you don't define what occurs if I want to respond by
lowering my carrier too.
Right now it'll deadlock if I do anything in that function of any
relevance.
So its broken, totally and utterly. Its the kind of undefined,
unserialized crap that I'm trying to get _OUT_ of the serial layer.
Now when you add it to the flip buffer as another event like errors the
line discipline knows the approximate time it occurred, has defined
semantics for ordering and queuing and can respond by flipping its modem
signals. You can
actually *use* it to implement things like half-duplex and multidrop.
Andrew - please reject the patch.
Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/