Re: [PATCH 1/2] Use kfifo to buffer USB generic serial writes

From: Greg KH
Date: Fri Aug 14 2009 - 16:18:23 EST


On Fri, Aug 14, 2009 at 01:02:51PM -0700, David VomLehn wrote:
> When do_output_char() attempts to write a carriage return/line feed sequence,
> it first checks to see how much buffer room is available. If there are at least
> two characters free, it will write the carriage return/line feed with two calls
> to tty_put_char(). It calls the tty_operation functions write() for devices that
> don't support the tty_operations function put_char(). If the USB generic serial
> device's write URB is not in use, it will return the buffer size when asked how
> much room is available. The write() of the carriage return will cause it to mark
> the write URB busy, so the subsequent write() of the line feed will be ignored.
>
> The first part of patch uses the kfifo infrastructure to implement a write
> FIFO that accurately returns the amount of space available in the buffer. The
> second makes a minor change to kfifo_put() and __kfifo_put() to add the "const"
> attribute to their input buffer pointers.
>
> Signed-off-by: David VomLehn

Yeah!

Thanks so much for doing this work, I'll go queue it up and test it
right away. I really appreciate it.

greg k-h
--
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/