Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28326
b: refs/heads/master
c: 2775562
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jun 21, 2006
1 parent 992e372 commit 8ee1c28
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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: 4de7d2c231a8624a47417977be0768c5b5257c4f
refs/heads/master: 2775562ad2af2fc131ef7987166db6e42217528f
24 changes: 15 additions & 9 deletions trunk/drivers/usb/host/uhci-q.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,8 +1148,9 @@ static int uhci_urb_enqueue(struct usb_hcd *hcd,

/* If the new URB is the first and only one on this QH then either
* the QH is new and idle or else it's unlinked and waiting to
* become idle, so we can activate it right away. */
if (qh->queue.next == &urbp->node)
* become idle, so we can activate it right away. But only if the
* queue isn't stopped. */
if (qh->queue.next == &urbp->node && !qh->is_stopped)
uhci_activate_qh(uhci, qh);
goto done;

Expand Down Expand Up @@ -1293,27 +1294,32 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh,
if (urb->status == -EINPROGRESS) /* Not dequeued */
urb->status = status;
else
status = -ECONNRESET;
status = ECONNRESET; /* Not -ECONNRESET */
spin_unlock(&urb->lock);

/* Dequeued but completed URBs can't be given back unless
* the QH is stopped or has finished unlinking. */
if (status == -ECONNRESET &&
!(qh->is_stopped || QH_FINISHED_UNLINKING(qh)))
return;
if (status == ECONNRESET) {
if (QH_FINISHED_UNLINKING(qh))
qh->is_stopped = 1;
else if (!qh->is_stopped)
return;
}

uhci_giveback_urb(uhci, qh, urb, regs);
if (qh->is_stopped)
if (status < 0)
break;
}

/* If the QH is neither stopped nor finished unlinking (normal case),
* our work here is done. */
restart:
if (!(qh->is_stopped || QH_FINISHED_UNLINKING(qh)))
if (QH_FINISHED_UNLINKING(qh))
qh->is_stopped = 1;
else if (!qh->is_stopped)
return;

/* Otherwise give back each of the dequeued URBs */
restart:
list_for_each_entry(urbp, &qh->queue, node) {
urb = urbp->urb;
if (urb->status != -EINPROGRESS) {
Expand Down

0 comments on commit 8ee1c28

Please sign in to comment.