]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "xhci: Avoid queuing redundant Stop Endpoint command for stalled endpoint"
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 10 Apr 2025 15:18:23 +0000 (18:18 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2025 12:36:55 +0000 (14:36 +0200)
This reverts commit 0c74d232578b1a7071e0312312811cb75b26b202.

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/84b400f8-2943-44e0-8803-f3aac3b670af@molgen.mpg.de
cc: Paul Menzel <pmenzel@molgen.mpg.de>
cc: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250410151828.2868740-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c

index 0452b8d65832b9a757b456ee8f8cacf7ab5c45c5..6370874bf2656a078df4a646b7620454cd516c8a 100644 (file)
@@ -1770,8 +1770,8 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
                goto done;
        }
 
-       /* In these cases no commands are pending but the endpoint is stopped */
-       if (ep->ep_state & (EP_CLEARING_TT | EP_STALLED)) {
+       /* In this case no commands are pending but the endpoint is stopped */
+       if (ep->ep_state & EP_CLEARING_TT) {
                /* and cancelled TDs can be given back right away */
                xhci_dbg(xhci, "Invalidating TDs instantly on slot %d ep %d in state 0x%x\n",
                                urb->dev->slot_id, ep_index, ep->ep_state);
@@ -3208,12 +3208,10 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd,
                return;
 
        ep = &vdev->eps[ep_index];
-
-       spin_lock_irqsave(&xhci->lock, flags);
-
        ep->ep_state &= ~EP_STALLED;
 
        /* Bail out if toggle is already being cleared by a endpoint reset */
+       spin_lock_irqsave(&xhci->lock, flags);
        if (ep->ep_state & EP_HARD_CLEAR_TOGGLE) {
                ep->ep_state &= ~EP_HARD_CLEAR_TOGGLE;
                spin_unlock_irqrestore(&xhci->lock, flags);