Commit af1352f8 authored by Mathias Nyman's avatar Mathias Nyman Committed by Greg Kroah-Hartman
Browse files

Revert "xhci: Avoid queuing redundant Stop Endpoint command for stalled endpoint"

This reverts commit 0c74d232.

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: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250410151828.2868740-2-mathias.nyman@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0af2f6be
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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);