]> Pileus Git - ~andy/linux/commitdiff
xhci: If no endpoints changed, don't issue BW command.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 2 Sep 2011 18:05:40 +0000 (11:05 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Sep 2011 22:52:52 +0000 (15:52 -0700)
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>
drivers/usb/host/xhci.c

index f647d918a886de0ee077ec417b385ed0776bbf9e..fcc5821a27f33b98a374fff6e279b97e78adaccf 100644 (file)
@@ -1888,6 +1888,12 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
        ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG);
        ctrl_ctx->add_flags &= cpu_to_le32(~EP0_FLAG);
        ctrl_ctx->drop_flags &= cpu_to_le32(~(SLOT_FLAG | EP0_FLAG));
+
+       /* Don't issue the command if there's no endpoints to update. */
+       if (ctrl_ctx->add_flags == cpu_to_le32(SLOT_FLAG) &&
+                       ctrl_ctx->drop_flags == 0)
+               return 0;
+
        xhci_dbg(xhci, "New Input Control Context:\n");
        slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
        xhci_dbg_ctx(xhci, virt_dev->in_ctx,