diff options
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 411da1fc7ae8..6bfbd80ec2b9 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -123,6 +123,16 @@ static int enqueue_is_link_trb(struct xhci_ring *ring) | |||
123 | return TRB_TYPE_LINK_LE32(link->control); | 123 | return TRB_TYPE_LINK_LE32(link->control); |
124 | } | 124 | } |
125 | 125 | ||
126 | union xhci_trb *xhci_find_next_enqueue(struct xhci_ring *ring) | ||
127 | { | ||
128 | /* Enqueue pointer can be left pointing to the link TRB, | ||
129 | * we must handle that | ||
130 | */ | ||
131 | if (TRB_TYPE_LINK_LE32(ring->enqueue->link.control)) | ||
132 | return ring->enq_seg->next->trbs; | ||
133 | return ring->enqueue; | ||
134 | } | ||
135 | |||
126 | /* Updates trb to point to the next TRB in the ring, and updates seg if the next | 136 | /* Updates trb to point to the next TRB in the ring, and updates seg if the next |
127 | * TRB is in a new segment. This does not skip over link TRBs, and it does not | 137 | * TRB is in a new segment. This does not skip over link TRBs, and it does not |
128 | * effect the ring dequeue or enqueue pointers. | 138 | * effect the ring dequeue or enqueue pointers. |
@@ -859,8 +869,12 @@ remove_finished_td: | |||
859 | /* Otherwise ring the doorbell(s) to restart queued transfers */ | 869 | /* Otherwise ring the doorbell(s) to restart queued transfers */ |
860 | ring_doorbell_for_active_rings(xhci, slot_id, ep_index); | 870 | ring_doorbell_for_active_rings(xhci, slot_id, ep_index); |
861 | } | 871 | } |
862 | ep->stopped_td = NULL; | 872 | |
863 | ep->stopped_trb = NULL; | 873 | /* Clear stopped_td and stopped_trb if endpoint is not halted */ |
874 | if (!(ep->ep_state & EP_HALTED)) { | ||
875 | ep->stopped_td = NULL; | ||
876 | ep->stopped_trb = NULL; | ||
877 | } | ||
864 | 878 | ||
865 | /* | 879 | /* |
866 | * Drop the lock and complete the URBs in the cancelled TD list. | 880 | * Drop the lock and complete the URBs in the cancelled TD list. |
@@ -1414,6 +1428,12 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, | |||
1414 | inc_deq(xhci, xhci->cmd_ring); | 1428 | inc_deq(xhci, xhci->cmd_ring); |
1415 | return; | 1429 | return; |
1416 | } | 1430 | } |
1431 | /* There is no command to handle if we get a stop event when the | ||
1432 | * command ring is empty, event->cmd_trb points to the next | ||
1433 | * unset command | ||
1434 | */ | ||
1435 | if (xhci->cmd_ring->dequeue == xhci->cmd_ring->enqueue) | ||
1436 | return; | ||
1417 | } | 1437 | } |
1418 | 1438 | ||
1419 | switch (le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3]) | 1439 | switch (le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3]) |
@@ -1743,6 +1763,19 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
1743 | } | 1763 | } |
1744 | } | 1764 | } |
1745 | 1765 | ||
1766 | /* | ||
1767 | * Check to see if xhci-hub.c is waiting on RExit to U0 transition (or | ||
1768 | * RExit to a disconnect state). If so, let the the driver know it's | ||
1769 | * out of the RExit state. | ||
1770 | */ | ||
1771 | if (!DEV_SUPERSPEED(temp) && | ||
1772 | test_and_clear_bit(faked_port_index, | ||
1773 | &bus_state->rexit_ports)) { | ||
1774 | complete(&bus_state->rexit_done[faked_port_index]); | ||
1775 | bogus_port_status = true; | ||
1776 | goto cleanup; | ||
1777 | } | ||
1778 | |||
1746 | if (hcd->speed != HCD_USB3) | 1779 | if (hcd->speed != HCD_USB3) |
1747 | xhci_test_and_clear_bit(xhci, port_array, faked_port_index, | 1780 | xhci_test_and_clear_bit(xhci, port_array, faked_port_index, |
1748 | PORT_PLC); | 1781 | PORT_PLC); |