Skip to content

Commit 856563b

Browse files
Epicuriusgregkh
authored andcommitted
usb: xhci: remove redundant update_ring_for_set_deq_completion() function
The function is a remnant from a previous implementation and is now redundant. There is no longer a need to search for the dequeue pointer, as both the TRB and segment dequeue pointers are saved within 'queued_deq_seg' and 'queued_deq_ptr'. Signed-off-by: Niklas Neronin <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b020761 commit 856563b

File tree

1 file changed

+2
-39
lines changed

1 file changed

+2
-39
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,43 +1332,6 @@ void xhci_hc_died(struct xhci_hcd *xhci)
13321332
usb_hc_died(xhci_to_hcd(xhci));
13331333
}
13341334

1335-
static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci,
1336-
struct xhci_virt_device *dev,
1337-
struct xhci_ring *ep_ring,
1338-
unsigned int ep_index)
1339-
{
1340-
union xhci_trb *dequeue_temp;
1341-
1342-
dequeue_temp = ep_ring->dequeue;
1343-
1344-
/* If we get two back-to-back stalls, and the first stalled transfer
1345-
* ends just before a link TRB, the dequeue pointer will be left on
1346-
* the link TRB by the code in the while loop. So we have to update
1347-
* the dequeue pointer one segment further, or we'll jump off
1348-
* the segment into la-la-land.
1349-
*/
1350-
if (trb_is_link(ep_ring->dequeue)) {
1351-
ep_ring->deq_seg = ep_ring->deq_seg->next;
1352-
ep_ring->dequeue = ep_ring->deq_seg->trbs;
1353-
}
1354-
1355-
while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) {
1356-
/* We have more usable TRBs */
1357-
ep_ring->dequeue++;
1358-
if (trb_is_link(ep_ring->dequeue)) {
1359-
if (ep_ring->dequeue ==
1360-
dev->eps[ep_index].queued_deq_ptr)
1361-
break;
1362-
ep_ring->deq_seg = ep_ring->deq_seg->next;
1363-
ep_ring->dequeue = ep_ring->deq_seg->trbs;
1364-
}
1365-
if (ep_ring->dequeue == dequeue_temp) {
1366-
xhci_dbg(xhci, "Unable to find new dequeue pointer\n");
1367-
break;
1368-
}
1369-
}
1370-
}
1371-
13721335
/*
13731336
* When we get a completion for a Set Transfer Ring Dequeue Pointer command,
13741337
* we need to clear the set deq pending flag in the endpoint ring state, so that
@@ -1473,8 +1436,8 @@ static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id,
14731436
/* Update the ring's dequeue segment and dequeue pointer
14741437
* to reflect the new position.
14751438
*/
1476-
update_ring_for_set_deq_completion(xhci, ep->vdev,
1477-
ep_ring, ep_index);
1439+
ep_ring->deq_seg = ep->queued_deq_seg;
1440+
ep_ring->dequeue = ep->queued_deq_ptr;
14781441
} else {
14791442
xhci_warn(xhci, "Mismatch between completed Set TR Deq Ptr command & xHCI internal state.\n");
14801443
xhci_warn(xhci, "ep deq seg = %p, deq ptr = %p\n",

0 commit comments

Comments
 (0)