Skip to content

Commit a613413

Browse files
jwrdegoedegregkh
authored andcommitted
xhci: Silence "xHCI xhci_drop_endpoint called with disabled ep ..." messages
When re-applying the configuration after a successful usb device reset, xhci_discover_or_reset_device has already dropped the endpoints, and free-ed the rings. The endpoints already being dropped is expected, and should not lead to warnings. Use the fact that the rings are also free-ed in this scenario to detect this, and suppress the "xHCI xhci_drop_endpoint called with disabled ep ..." message in this case. Signed-off-by: Hans de Goede <[email protected]> -- Changes in v2: Move the ring check to only guard the xhci_warn, so as to avoid side-effects in case we have a scenario where the rings are free-ed, but the endpoint is not yet dropped. Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9970509 commit a613413

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/usb/host/xhci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,8 +1673,10 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
16731673
cpu_to_le32(EP_STATE_DISABLED)) ||
16741674
le32_to_cpu(ctrl_ctx->drop_flags) &
16751675
xhci_get_endpoint_flag(&ep->desc)) {
1676-
xhci_warn(xhci, "xHCI %s called with disabled ep %p\n",
1677-
__func__, ep);
1676+
/* Do not warn when called after a usb_device_reset */
1677+
if (xhci->devs[udev->slot_id]->eps[ep_index].ring != NULL)
1678+
xhci_warn(xhci, "xHCI %s called with disabled ep %p\n",
1679+
__func__, ep);
16781680
return 0;
16791681
}
16801682

0 commit comments

Comments
 (0)