diff options
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 23b4aefd1036..8275645889da 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -885,6 +885,17 @@ static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci, | |||
885 | num_trbs_free_temp = ep_ring->num_trbs_free; | 885 | num_trbs_free_temp = ep_ring->num_trbs_free; |
886 | dequeue_temp = ep_ring->dequeue; | 886 | dequeue_temp = ep_ring->dequeue; |
887 | 887 | ||
888 | /* If we get two back-to-back stalls, and the first stalled transfer | ||
889 | * ends just before a link TRB, the dequeue pointer will be left on | ||
890 | * the link TRB by the code in the while loop. So we have to update | ||
891 | * the dequeue pointer one segment further, or we'll jump off | ||
892 | * the segment into la-la-land. | ||
893 | */ | ||
894 | if (last_trb(xhci, ep_ring, ep_ring->deq_seg, ep_ring->dequeue)) { | ||
895 | ep_ring->deq_seg = ep_ring->deq_seg->next; | ||
896 | ep_ring->dequeue = ep_ring->deq_seg->trbs; | ||
897 | } | ||
898 | |||
888 | while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) { | 899 | while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) { |
889 | /* We have more usable TRBs */ | 900 | /* We have more usable TRBs */ |
890 | ep_ring->num_trbs_free++; | 901 | ep_ring->num_trbs_free++; |