Skip to content

Commit b513cc1

Browse files
matnymangregkh
authored andcommitted
Revert "xhci: Prevent early endpoint restart when handling STALL errors."
This reverts commit 860f5d0. 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 af1352f commit b513cc1

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ void xhci_ring_ep_doorbell(struct xhci_hcd *xhci,
561561
* pointer command pending because the device can choose to start any
562562
* stream once the endpoint is on the HW schedule.
563563
*/
564-
if (ep_state & (EP_STOP_CMD_PENDING | SET_DEQ_PENDING | EP_HALTED |
565-
EP_CLEARING_TT | EP_STALLED))
564+
if ((ep_state & EP_STOP_CMD_PENDING) || (ep_state & SET_DEQ_PENDING) ||
565+
(ep_state & EP_HALTED) || (ep_state & EP_CLEARING_TT))
566566
return;
567567

568568
trace_xhci_ring_ep_doorbell(slot_id, DB_VALUE(ep_index, stream_id));
@@ -2573,9 +2573,6 @@ static void process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_virt_ep *ep,
25732573

25742574
xhci_handle_halted_endpoint(xhci, ep, td, EP_SOFT_RESET);
25752575
return;
2576-
case COMP_STALL_ERROR:
2577-
ep->ep_state |= EP_STALLED;
2578-
break;
25792576
default:
25802577
/* do nothing */
25812578
break;

drivers/usb/host/xhci.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,11 +1605,6 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
16051605
goto free_priv;
16061606
}
16071607

1608-
/* Class driver might not be aware ep halted due to async URB giveback */
1609-
if (*ep_state & EP_STALLED)
1610-
dev_dbg(&urb->dev->dev, "URB %p queued before clearing halt\n",
1611-
urb);
1612-
16131608
switch (usb_endpoint_type(&urb->ep->desc)) {
16141609

16151610
case USB_ENDPOINT_XFER_CONTROL:
@@ -3208,7 +3203,6 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd,
32083203
return;
32093204

32103205
ep = &vdev->eps[ep_index];
3211-
ep->ep_state &= ~EP_STALLED;
32123206

32133207
/* Bail out if toggle is already being cleared by a endpoint reset */
32143208
spin_lock_irqsave(&xhci->lock, flags);

drivers/usb/host/xhci.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ struct xhci_virt_ep {
664664
unsigned int err_count;
665665
unsigned int ep_state;
666666
#define SET_DEQ_PENDING (1 << 0)
667-
#define EP_HALTED (1 << 1) /* Halted host ep handling */
667+
#define EP_HALTED (1 << 1) /* For stall handling */
668668
#define EP_STOP_CMD_PENDING (1 << 2) /* For URB cancellation */
669669
/* Transitioning the endpoint to using streams, don't enqueue URBs */
670670
#define EP_GETTING_STREAMS (1 << 3)
@@ -675,7 +675,6 @@ struct xhci_virt_ep {
675675
#define EP_SOFT_CLEAR_TOGGLE (1 << 7)
676676
/* usb_hub_clear_tt_buffer is in progress */
677677
#define EP_CLEARING_TT (1 << 8)
678-
#define EP_STALLED (1 << 9) /* For stall handling */
679678
/* ---- Related to URB cancellation ---- */
680679
struct list_head cancelled_td_list;
681680
struct xhci_hcd *xhci;

0 commit comments

Comments
 (0)