Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250306144954.3507700-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Niklas Neronin and committed by
Greg Kroah-Hartman
856563be b020761e

+2 -39
+2 -39
drivers/usb/host/xhci-ring.c
··· 1332 1332 usb_hc_died(xhci_to_hcd(xhci)); 1333 1333 } 1334 1334 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 - 1372 1335 /* 1373 1336 * When we get a completion for a Set Transfer Ring Dequeue Pointer command, 1374 1337 * we need to clear the set deq pending flag in the endpoint ring state, so that ··· 1436 1473 /* Update the ring's dequeue segment and dequeue pointer 1437 1474 * to reflect the new position. 1438 1475 */ 1439 - update_ring_for_set_deq_completion(xhci, ep->vdev, 1440 - ep_ring, ep_index); 1476 + ep_ring->deq_seg = ep->queued_deq_seg; 1477 + ep_ring->dequeue = ep->queued_deq_ptr; 1441 1478 } else { 1442 1479 xhci_warn(xhci, "Mismatch between completed Set TR Deq Ptr command & xHCI internal state.\n"); 1443 1480 xhci_warn(xhci, "ep deq seg = %p, deq ptr = %p\n",