aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2011-09-02 14:05:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-11 12:36:44 -0500
commit567c6a1ce9d9417c33176bb848a6287f5bae6dd4 (patch)
treeda6a6143cf2342cc34b926d45aaaad76654df4d0 /drivers/usb/host/xhci.c
parent6eb006c6079fd54a260caf7dfb3c750f65f4b1fc (diff)
xhci: If no endpoints changed, don't issue BW command.
commit 2dc3753997f3c80ce8b950242ab9bb3fb936acfd upstream. Some alternate interface settings have no endpoints associated with them. This shows up in some USB webcams, particularly the Logitech HD 1080p, which uses the uvcvideo driver. If a driver switches between two alt settings with no endpoints, there is no need to issue a configure endpoint command, because there is no endpoint information to update. The only time a configure endpoint command with just the add slot flag set makes sense is when the driver is updating hub characteristics in the slot context. However, that code never calls xhci_check_bandwidth, so we should be safe not issuing a command if only the slot context add flag is set. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r--drivers/usb/host/xhci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 7ea48b342aa..fb61e9d8e17 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1889,6 +1889,12 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
1889 ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG); 1889 ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG);
1890 ctrl_ctx->add_flags &= cpu_to_le32(~EP0_FLAG); 1890 ctrl_ctx->add_flags &= cpu_to_le32(~EP0_FLAG);
1891 ctrl_ctx->drop_flags &= cpu_to_le32(~(SLOT_FLAG | EP0_FLAG)); 1891 ctrl_ctx->drop_flags &= cpu_to_le32(~(SLOT_FLAG | EP0_FLAG));
1892
1893 /* Don't issue the command if there's no endpoints to update. */
1894 if (ctrl_ctx->add_flags == cpu_to_le32(SLOT_FLAG) &&
1895 ctrl_ctx->drop_flags == 0)
1896 return 0;
1897
1892 xhci_dbg(xhci, "New Input Control Context:\n"); 1898 xhci_dbg(xhci, "New Input Control Context:\n");
1893 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); 1899 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
1894 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 1900 xhci_dbg_ctx(xhci, virt_dev->in_ctx,