Re: [PATCH resend 2/2] xhci: Silence "xHCI xhci_drop_endpoint called with disabled ep ..." messages

2015-01-16 Thread Mathias Nyman
On 09.01.2015 16:57, Hans de Goede wrote:
> 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 
> 
> --

Thanks, I'll send both forward

-Mathias

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH resend 2/2] xhci: Silence "xHCI xhci_drop_endpoint called with disabled ep ..." messages

2015-01-09 Thread Hans de Goede
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 

--
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.
---
 drivers/usb/host/xhci.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index bb3e328..305aacf 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1676,8 +1676,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;
}
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html