Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195354
b: refs/heads/master
c: 50a5f70
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed May 20, 2010
1 parent 72d7fa1 commit 5c9c840
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1a1405e22563151de79fdc83aa5e5815d10f0291
refs/heads/master: 50a5f70cee11636908711abd339f5c5933375a7d
15 changes: 4 additions & 11 deletions trunk/drivers/usb/serial/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,22 +259,15 @@ static int usb_serial_generic_write_start(struct usb_serial_port *port)
int result;
int count;
unsigned long flags;
bool start_io;

/* Atomically determine whether we can and need to start a USB
* operation. */
spin_lock_irqsave(&port->lock, flags);
if (port->write_urb_busy)
start_io = false;
else {
start_io = (kfifo_len(&port->write_fifo) != 0);
port->write_urb_busy = start_io;
if (port->write_urb_busy || !kfifo_len(&port->write_fifo)) {
spin_unlock_irqrestore(&port->lock, flags);
return 0;
}
port->write_urb_busy = 1;
spin_unlock_irqrestore(&port->lock, flags);

if (!start_io)
return 0;

data = port->write_urb->transfer_buffer;
count = kfifo_out_locked(&port->write_fifo, data, port->bulk_out_size, &port->lock);
usb_serial_debug_data(debug, &port->dev, __func__, count, data);
Expand Down

0 comments on commit 5c9c840

Please sign in to comment.