Skip to content

Commit 3321f84

Browse files
matnymangregkh
authored andcommitted
xhci: simplify event ring dequeue tracking for transfer events
No matter what type of event we receive we want to increase the event ring dequeue pointer one step for every event that is handled. For unknown reasons the event ring dequeue increase is done inside the transfer event handler and port event handler. As the transfer event handler got more complex and can now loop through several transfer TRBs on a transfer ring, there were additinal checks added to avoid increasing event ring dequeue more than one step. No need for elaborate checks to avoid increasing event ring dequeue in case the transfer event handler goes through a loop. Just increasing the event ring dequeue outside the transfer event handler. End goal is to increase event ring dequeue in just one place. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20231019102924.2797346-13-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3c45a21 commit 3321f84

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,13 +2884,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
28842884
trb_comp_code != COMP_MISSED_SERVICE_ERROR &&
28852885
trb_comp_code != COMP_NO_PING_RESPONSE_ERROR;
28862886

2887-
/*
2888-
* Do not update event ring dequeue pointer if we're in a loop
2889-
* processing missed tds.
2890-
*/
2891-
if (!handling_skipped_tds)
2892-
inc_deq(xhci, ir->event_ring);
2893-
28942887
/*
28952888
* If ep->skip is set, it means there are missed tds on the
28962889
* endpoint ring need to take care of.
@@ -2924,7 +2917,6 @@ static int xhci_handle_event(struct xhci_hcd *xhci, struct xhci_interrupter *ir)
29242917
union xhci_trb *event;
29252918
int update_ptrs = 1;
29262919
u32 trb_type;
2927-
int ret;
29282920

29292921
/* Event ring hasn't been allocated yet. */
29302922
if (!ir || !ir->event_ring || !ir->event_ring->dequeue) {
@@ -2957,9 +2949,7 @@ static int xhci_handle_event(struct xhci_hcd *xhci, struct xhci_interrupter *ir)
29572949
update_ptrs = 0;
29582950
break;
29592951
case TRB_TRANSFER:
2960-
ret = handle_tx_event(xhci, ir, &event->trans_event);
2961-
if (ret >= 0)
2962-
update_ptrs = 0;
2952+
handle_tx_event(xhci, ir, &event->trans_event);
29632953
break;
29642954
case TRB_DEV_NOTE:
29652955
handle_device_notification(xhci, event);

0 commit comments

Comments
 (0)