xhci: Silence "xHCI xhci_drop_endpoint called with disabled ep ..." messages
authorHans de Goede <hdegoede@redhat.com>
Fri, 16 Jan 2015 15:54:02 +0000 (17:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jan 2015 12:59:43 +0000 (20:59 +0800)
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 <hdegoede@redhat.com>
--
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 <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c

index 15d8c221442f782e992b7e671a4522a7b2e16ee7..ec8ac16748547a2ac87bf9aa225ed0a36c0bf7df 100644 (file)
@@ -1673,8 +1673,10 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
             cpu_to_le32(EP_STATE_DISABLED)) ||
            le32_to_cpu(ctrl_ctx->drop_flags) &
            xhci_get_endpoint_flag(&ep->desc)) {
-               xhci_warn(xhci, "xHCI %s called with disabled ep %p\n",
-                               __func__, ep);
+               /* Do not warn when called after a usb_device_reset */
+               if (xhci->devs[udev->slot_id]->eps[ep_index].ring != NULL)
+                       xhci_warn(xhci, "xHCI %s called with disabled ep %p\n",
+                                 __func__, ep);
                return 0;
        }