diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:05:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:05:02 -0400 |
commit | 9895850b23886e030cd1e7241d5529a57e969c3d (patch) | |
tree | 1061626db450aeb72dcfcd247c24b33e5238c8c4 /drivers/usb/serial/generic.c | |
parent | fc385c313275b114bc6ad36e60c5177d63250548 (diff) | |
parent | b58af4066d240b18b43f202e07b9ec7461d90b17 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (148 commits)
USB: serial: fix stalled writes
USB: remove fake "address-of" expressions
USB: fix thread-unsafe anchor utiliy routines
USB: usbtest: support test device with only one iso-in or iso-out endpoint
USB: usbtest: avoid to free coherent buffer in atomic context
USB: xhci: Set DMA mask for host.
USB: xhci: Don't flush doorbell writes.
USB: xhci: Reduce reads and writes of interrupter registers.
USB: xhci: Make xhci_set_hc_event_deq() static.
USB: xhci: Minimize HW event ring dequeue pointer writes.
USB: xhci: Make xhci_handle_event() static.
USB: xhci: Remove unnecessary reads of IRQ_PENDING register.
USB: xhci: Performance - move xhci_work() into xhci_irq()
USB: xhci: Performance - move interrupt handlers into xhci-ring.c
USB: xhci: Performance - move functions that find ep ring.
USB:: fix linux/usb.h kernel-doc warnings
USB: add USB serial ssu100 driver
USB: usb-storage: implement autosuspend
USB: ehci: fix remove of ehci debugfs dir
USB: Add USB 2.0 to ssb ohci driver
...
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r-- | drivers/usb/serial/generic.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index a817ced82835..ca92f67747cc 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -208,18 +208,23 @@ retry: | |||
208 | urb->transfer_buffer_length = count; | 208 | urb->transfer_buffer_length = count; |
209 | usb_serial_debug_data(debug, &port->dev, __func__, count, | 209 | usb_serial_debug_data(debug, &port->dev, __func__, count, |
210 | urb->transfer_buffer); | 210 | urb->transfer_buffer); |
211 | spin_lock_irqsave(&port->lock, flags); | ||
212 | port->tx_bytes += count; | ||
213 | spin_unlock_irqrestore(&port->lock, flags); | ||
214 | |||
215 | clear_bit(i, &port->write_urbs_free); | ||
211 | result = usb_submit_urb(urb, GFP_ATOMIC); | 216 | result = usb_submit_urb(urb, GFP_ATOMIC); |
212 | if (result) { | 217 | if (result) { |
213 | dev_err(&port->dev, "%s - error submitting urb: %d\n", | 218 | dev_err(&port->dev, "%s - error submitting urb: %d\n", |
214 | __func__, result); | 219 | __func__, result); |
220 | set_bit(i, &port->write_urbs_free); | ||
221 | spin_lock_irqsave(&port->lock, flags); | ||
222 | port->tx_bytes -= count; | ||
223 | spin_unlock_irqrestore(&port->lock, flags); | ||
224 | |||
215 | clear_bit_unlock(USB_SERIAL_WRITE_BUSY, &port->flags); | 225 | clear_bit_unlock(USB_SERIAL_WRITE_BUSY, &port->flags); |
216 | return result; | 226 | return result; |
217 | } | 227 | } |
218 | clear_bit(i, &port->write_urbs_free); | ||
219 | |||
220 | spin_lock_irqsave(&port->lock, flags); | ||
221 | port->tx_bytes += count; | ||
222 | spin_unlock_irqrestore(&port->lock, flags); | ||
223 | 228 | ||
224 | /* Try sending off another urb, unless in irq context (in which case | 229 | /* Try sending off another urb, unless in irq context (in which case |
225 | * there will be no free urb). */ | 230 | * there will be no free urb). */ |