Greg KH wrote:
> 
> On Fri, May 19, 2000 at 12:00:21PM -0500, Al Borchers wrote:
> >
> > Our driver has a problem with select--select reports our device is ready
> > for writing, but write sometimes returns -EAGAIN.
> 
> Not to say that the driver shouldn't be fixed to work properly though :)

I fixed this problem by having chars_in_buffer return 256 when the write_urb
status was -EINPROGRESS.  The normal_poll function in the line discipline
code (drivers/char/n_tty.c) handles select and poll.  If the driver reports
chars_in_buffer is less than 256 it assumes there is room to write more.  So
if we aren't ready for a write (for example, status==-EINPROGRESS) we have
to have chars_in_buffer report at least 256.

Brian already figured this out in the Keyspan driver, but his chars_in_buffer
only returns 256 if transmit is throttled--that is right, but not enough.
Keyspan has the same problem with select as the Digi driver--select thinks
the port is writable when -EINPROGRESS is set, but it is not.

-- Al

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to