Commit cf59b853 authored by Al Borchers's avatar Al Borchers Committed by Greg Kroah-Hartman

[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: default avatarAl Borchers <alborchers@steinerpoint.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 6e145314
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment