usb: xhci: move process TD code out of the while loop
This part is and should only performed once, so it's moved out of the while loop to improve code readability. 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/20240626124835.1023046-19-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
132dcf65fc
commit
c43e43e8a7
@ -2868,10 +2868,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
|
||||
return -ESHUTDOWN;
|
||||
}
|
||||
}
|
||||
if (trb_comp_code == COMP_SHORT_PACKET)
|
||||
ep_ring->last_td_was_short = true;
|
||||
else
|
||||
ep_ring->last_td_was_short = false;
|
||||
|
||||
if (ep->skip) {
|
||||
xhci_dbg(xhci,
|
||||
@ -2880,17 +2876,26 @@ static int handle_tx_event(struct xhci_hcd *xhci,
|
||||
ep->skip = false;
|
||||
}
|
||||
|
||||
ep_trb = &ep_seg->trbs[(ep_trb_dma - ep_seg->dma) /
|
||||
sizeof(*ep_trb)];
|
||||
/*
|
||||
* If ep->skip is set, it means there are missed tds on the
|
||||
* endpoint ring need to take care of.
|
||||
* Process them as short transfer until reach the td pointed by
|
||||
* the event.
|
||||
*/
|
||||
} while (ep->skip);
|
||||
|
||||
trace_xhci_handle_transfer(ep_ring,
|
||||
(struct xhci_generic_trb *) ep_trb);
|
||||
if (trb_comp_code == COMP_SHORT_PACKET)
|
||||
ep_ring->last_td_was_short = true;
|
||||
else
|
||||
ep_ring->last_td_was_short = false;
|
||||
|
||||
ep_trb = &ep_seg->trbs[(ep_trb_dma - ep_seg->dma) / sizeof(*ep_trb)];
|
||||
trace_xhci_handle_transfer(ep_ring, (struct xhci_generic_trb *) ep_trb);
|
||||
|
||||
/*
|
||||
* No-op TRB could trigger interrupts in a case where
|
||||
* a URB was killed and a STALL_ERROR happens right
|
||||
* after the endpoint ring stopped. Reset the halted
|
||||
* endpoint. Otherwise, the endpoint remains stalled
|
||||
* No-op TRB could trigger interrupts in a case where a URB was killed
|
||||
* and a STALL_ERROR happens right after the endpoint ring stopped.
|
||||
* Reset the halted endpoint. Otherwise, the endpoint remains stalled
|
||||
* indefinitely.
|
||||
*/
|
||||
|
||||
@ -2908,13 +2913,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
|
||||
else
|
||||
process_bulk_intr_td(xhci, ep, ep_ring, td, ep_trb, event);
|
||||
}
|
||||
/*
|
||||
* If ep->skip is set, it means there are missed tds on the
|
||||
* endpoint ring need to take care of.
|
||||
* Process them as short transfer until reach the td pointed by
|
||||
* the event.
|
||||
*/
|
||||
} while (ep->skip);
|
||||
|
||||
return 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user