All of lore.kernel.org
 help / color / mirror / Atom feed
* Dropped characters in serial connection without flow control
@ 2009-10-28 17:59 Peter Stuge
  2009-10-28 18:05 ` Greg KH
  2009-10-28 18:16 ` Alan Cox
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Stuge @ 2009-10-28 17:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alan Cox, Greg KH

Peter Stuge wrote:
> I'm writing a line discipline for a serial port multiplexing
> hardware

There is no(!) support for flow control in the hardware.

Is there anything I can do to reduce serial port interrupt latency or
otherwise try to mitigate this in my ldisc or in Linux in general? I
realize that it will never be quite reliable without any flow
control.

Baud rate is currently 115200 but could become 57600.

Is there something in particular that I can do wrong or right in
the ldisc?

Might it be a good idea to add a circ_buf in the receiver path and
move out any and all attempts at parsing incoming data? Currently
it has a simple message buffer and a state machine in there.

Characters are dropped both going out and coming in. Nothing to do
about the out direction, but maybe input can be made reliable?

I don't expect it, but maybe you know a trick?


//Peter

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

* Re: Dropped characters in serial connection without flow control
  2009-10-28 17:59 Dropped characters in serial connection without flow control Peter Stuge
@ 2009-10-28 18:05 ` Greg KH
  2009-10-28 18:19   ` Peter Stuge
  2009-10-28 18:16 ` Alan Cox
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2009-10-28 18:05 UTC (permalink / raw)
  To: linux-kernel, Alan Cox

On Wed, Oct 28, 2009 at 06:59:37PM +0100, Peter Stuge wrote:
> Peter Stuge wrote:
> > I'm writing a line discipline for a serial port multiplexing
> > hardware
> 
> There is no(!) support for flow control in the hardware.
> 
> Is there anything I can do to reduce serial port interrupt latency or
> otherwise try to mitigate this in my ldisc or in Linux in general? I
> realize that it will never be quite reliable without any flow
> control.

What's wrong with XON/XOFF?  That is a well-known flow control protocol
for systems without hardware support for it.

And since when is adding a UART to a hardware chip expensive these days?

thanks,

greg k-h

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

* Re: Dropped characters in serial connection without flow control
  2009-10-28 17:59 Dropped characters in serial connection without flow control Peter Stuge
  2009-10-28 18:05 ` Greg KH
@ 2009-10-28 18:16 ` Alan Cox
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Cox @ 2009-10-28 18:16 UTC (permalink / raw)
  To: Peter Stuge; +Cc: linux-kernel, Greg KH

> There is no(!) support for flow control in the hardware.

So do XON/XOFF ?

> Is there anything I can do to reduce serial port interrupt latency or
> otherwise try to mitigate this in my ldisc or in Linux in general? I
> realize that it will never be quite reliable without any flow
> control.
> 
> Baud rate is currently 115200 but could become 57600.

The core tty buffering code tops out at about 40Mbits on a decent PC
system so you shouldn't be seeing problems from that. Our internal
buffering is about 64K which at 115200 is actually over 5 seconds.

> Is there something in particular that I can do wrong or right in
> the ldisc?
> 
> Might it be a good idea to add a circ_buf in the receiver path and
> move out any and all attempts at parsing incoming data? Currently
> it has a simple message buffer and a state machine in there.

ldisc processing is not done in the receiver path

> Characters are dropped both going out and coming in. Nothing to do
> about the out direction, but maybe input can be made reliable?
> 
> I don't expect it, but maybe you know a trick?

Without knowing more about the hardware and the code and the like its a
bit tricky to even guess what your problems are.

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

* Re: Dropped characters in serial connection without flow control
  2009-10-28 18:05 ` Greg KH
@ 2009-10-28 18:19   ` Peter Stuge
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stuge @ 2009-10-28 18:19 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Alan Cox

Greg KH wrote:
> > There is no(!) support for flow control in the hardware.
> > 
> > Is there anything I can do
> 
> What's wrong with XON/XOFF?

That was my thought also. I asked about flow control, both hardware
and software, and got word from the firmware developer that the
device firmware can not be changed to support hardware flow control.
I didn't get a comment on XON/XOFF and have already asked again.
Meanwhile I wanted to also check here.


> And since when is adding a UART to a hardware chip expensive these
> days?

I agree. I'm trying to work toward a more advanced hardware solution.


//Peter

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

end of thread, other threads:[~2009-10-28 18:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-28 17:59 Dropped characters in serial connection without flow control Peter Stuge
2009-10-28 18:05 ` Greg KH
2009-10-28 18:19   ` Peter Stuge
2009-10-28 18:16 ` Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.