Skip to content

Commit af1352f

Browse files
matnymangregkh
authored andcommitted
Revert "xhci: Avoid queuing redundant Stop Endpoint command for stalled endpoint"
This reverts commit 0c74d23. Paul Menzel reported that the two EP_STALLED patches in 6.15-rc1 cause regression. Turns out that the new flag may never get cleared after reset-resume, preventing xhci from restarting the endpoint. Revert this to take a proper look at it. Link: https://lore.kernel.org/linux-usb/[email protected] cc: Paul Menzel <[email protected]> cc: Michal Pecio <[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 0af2f6b commit af1352f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/usb/host/xhci.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,8 +1770,8 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
17701770
goto done;
17711771
}
17721772

1773-
/* In these cases no commands are pending but the endpoint is stopped */
1774-
if (ep->ep_state & (EP_CLEARING_TT | EP_STALLED)) {
1773+
/* In this case no commands are pending but the endpoint is stopped */
1774+
if (ep->ep_state & EP_CLEARING_TT) {
17751775
/* and cancelled TDs can be given back right away */
17761776
xhci_dbg(xhci, "Invalidating TDs instantly on slot %d ep %d in state 0x%x\n",
17771777
urb->dev->slot_id, ep_index, ep->ep_state);
@@ -3208,12 +3208,10 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd,
32083208
return;
32093209

32103210
ep = &vdev->eps[ep_index];
3211-
3212-
spin_lock_irqsave(&xhci->lock, flags);
3213-
32143211
ep->ep_state &= ~EP_STALLED;
32153212

32163213
/* Bail out if toggle is already being cleared by a endpoint reset */
3214+
spin_lock_irqsave(&xhci->lock, flags);
32173215
if (ep->ep_state & EP_HARD_CLEAR_TOGGLE) {
32183216
ep->ep_state &= ~EP_HARD_CLEAR_TOGGLE;
32193217
spin_unlock_irqrestore(&xhci->lock, flags);

0 commit comments

Comments
 (0)