Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235317
b: refs/heads/master
c: 16871dc
h: refs/heads/master
i:
  235315: ca9b8ba
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Feb 17, 2011
1 parent fcee68f commit ad263f1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 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: 433508ae30f13c0bf6905e576c42899a8535f0bb
refs/heads/master: 16871dcac74c63227aa92e0012f3004a648c2062
23 changes: 22 additions & 1 deletion trunk/drivers/usb/serial/usb_wwan.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,18 @@ int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message)
}
EXPORT_SYMBOL(usb_wwan_suspend);

static void unbusy_queued_urb(struct urb *urb, struct usb_wwan_port_private *portdata)
{
int i;

for (i = 0; i < N_OUT_URB; i++) {
if (urb == portdata->out_urbs[i]) {
clear_bit(i, &portdata->out_busy);
break;
}
}
}

static void play_delayed(struct usb_serial_port *port)
{
struct usb_wwan_intf_private *data;
Expand All @@ -675,8 +687,17 @@ static void play_delayed(struct usb_serial_port *port)
data = port->serial->private;
while ((urb = usb_get_from_anchor(&portdata->delayed))) {
err = usb_submit_urb(urb, GFP_ATOMIC);
if (!err)
if (!err) {
data->in_flight++;
} else {
/* we have to throw away the rest */
do {
unbusy_queued_urb(urb, portdata);
//extremely dirty
atomic_dec(&port->serial->interface->dev.power.usage_count);
} while ((urb = usb_get_from_anchor(&portdata->delayed)));
break;
}
}
}

Expand Down

0 comments on commit ad263f1

Please sign in to comment.