@@ -454,6 +454,10 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
}
}
+ /* complete URBs after unlinking */
+ if (stopped && state != QH_STATE_IDLE)
+ goto exit;
+
/* unless we already know the urb's status, collect qtd status
* and update count of bytes transferred. in common short read
* cases with only one data qtd (including control transfers),
@@ -489,15 +493,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
}
}
- /* if we're removing something not at the queue head,
- * patch the hardware queue pointer.
- */
- if (stopped && qtd->qtd_list.prev != &qh->qtd_list) {
- last = list_entry (qtd->qtd_list.prev,
- struct ehci_qtd, qtd_list);
- last->hw_next = qtd->hw_next;
- }
-
/* remove qtd; it's recycled after possible urb completion */
list_del (&qtd->qtd_list);
last = qtd;
@@ -520,7 +515,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
/* Otherwise the caller must unlink the QH. */
}
-
+ exit:
/* restore original state; caller must unlink or relink */
qh->qh_state = state;