[PATCH] USB: circular buffer for pl2303
Here is the patch adding a circular buffer to pl2303 updated to 2.6.9-rc1. Phil and I both tested this. (Phil tested a slightly different earlier version.) This fixes the carriage return newline problem Olaf Hering reported and helps Phil with hotsyncing his phone. This patch also fixes a problem that would sometimes leave a pl2303 port unable to send data, reporting "already writing", after closing the port while writing was in progress. This happened about 1/3 of the time in my tests with the stock 2.6.9-rc1 pl2303 driver. - Added a circular write buffer, protected by the existing spin lock. - Write_room and chars_in_buffer now report room and chars in the circular buffer. - Added a "bounce buffer" when transfering data from user space to the circular buffer--needed for locking. - Replaced (urb->status != -EINPROGRESS) with a private write_urb_in_use flag protected by the existing spin lock. Clear this flag when the urb is unlinked. - Free memory on failed startup. - These changes make ONLCR mapping work and fix a bug that would sometimes leave the port unable to write, reporting "already writing", after closing the port while writing was in progress. Signed-off-by: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Showing
This diff is collapsed.
Please register or sign in to comment