Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131889
b: refs/heads/master
c: dc61d23
h: refs/heads/master
i:
  131887: e07656f
v: v3
  • Loading branch information
Sergei Shtylyov authored and Greg Kroah-Hartman committed Feb 27, 2009
1 parent df930e6 commit 17eef37
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 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: a2fd814e6a9e172f7077b68a2a9391bbde777a92
refs/heads/master: dc61d238b8c850c34632ae1fbbdea529f8c41d16
36 changes: 26 additions & 10 deletions trunk/drivers/usb/musb/musb_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -2103,15 +2103,16 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
unsigned long flags;
struct musb *musb = hcd_to_musb(hcd);
u8 is_in = epnum & USB_DIR_IN;
struct musb_qh *qh = hep->hcpriv;
struct urb *urb, *tmp;
struct musb_qh *qh;
struct urb *urb;
struct list_head *sched;

if (!qh)
return;

spin_lock_irqsave(&musb->lock, flags);

qh = hep->hcpriv;
if (qh == NULL)
goto exit;

switch (qh->type) {
case USB_ENDPOINT_XFER_CONTROL:
sched = &musb->control;
Expand Down Expand Up @@ -2145,13 +2146,28 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)

/* cleanup */
musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
} else
urb = NULL;

/* then just nuke all the others */
list_for_each_entry_safe_from(urb, tmp, &hep->urb_list, urb_list)
musb_giveback(qh, urb, -ESHUTDOWN);
/* Then nuke all the others ... and advance the
* queue on hw_ep (e.g. bulk ring) when we're done.
*/
while (!list_empty(&hep->urb_list)) {
urb = next_urb(qh);
urb->status = -ESHUTDOWN;
musb_advance_schedule(musb, urb, qh->hw_ep, is_in);
}
} else {
/* Just empty the queue; the hardware is busy with
* other transfers, and since !qh->is_ready nothing
* will activate any of these as it advances.
*/
while (!list_empty(&hep->urb_list))
__musb_giveback(musb, next_urb(qh), -ESHUTDOWN);

hep->hcpriv = NULL;
list_del(&qh->ring);
kfree(qh);
}
exit:
spin_unlock_irqrestore(&musb->lock, flags);
}

Expand Down

0 comments on commit 17eef37

Please sign in to comment.