Skip to contentSkip to conversation

xhci: Don't always run the default stop endpoint command completion handler

PATCH New Mathias Nyman 1 participant 1 message Mar 16, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/9 xhci: Don't always run the default stop endpoint command completion handler

The default stop endpoint completion handler will give back cancelled URBs, and clean, or move past those canceller TRBs on the ring.

This is not always the preferred action.

If the stop endpoint command issuer is waiting for a completion skip the default handler and just call the completion.

---
 drivers/usb/host/xhci-ring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-ring.c +2 -1
index 88071c4..86476c6 100644
@@ -1436,7 +1436,8 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
 	case TRB_STOP_RING:
 		WARN_ON(slot_id != TRB_TO_SLOT_ID(
 				le32_to_cpu(cmd_trb->generic.field[3])));
-		xhci_handle_cmd_stop_ep(xhci, slot_id, cmd_trb, event);
+		if (!cmd->completion)
+			xhci_handle_cmd_stop_ep(xhci, slot_id, cmd_trb, event);
 		break;
 	case TRB_SET_DEQ:
 		WARN_ON(slot_id != TRB_TO_SLOT_ID(