On Mon, May 22, 2000 at 12:39:36AM -0500, Al Borchers wrote:
> 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.

Hm, I like a hack just as much as the next person but...

I agree that this fixes the problem today, but something just doesn't feel
good about relying on returning 256 from chars_in_buffer in accomplishing
this.

I'm crossposting this to the linux-serial mailing list to see if anyone
there has any opinions about this. Anyone?

greg k-h
greg@(kroah|wirex).com

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

Reply via email to