]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.1.1/xhci-if-no-endpoints-changed-don-t-issue-bw-command.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.1.1 / xhci-if-no-endpoints-changed-don-t-issue-bw-command.patch
CommitLineData
6ee55f20
GKH
1From 2dc3753997f3c80ce8b950242ab9bb3fb936acfd Mon Sep 17 00:00:00 2001
2From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
3Date: Fri, 2 Sep 2011 11:05:40 -0700
4Subject: xhci: If no endpoints changed, don't issue BW command.
5
6From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
7
8commit 2dc3753997f3c80ce8b950242ab9bb3fb936acfd upstream.
9
10Some alternate interface settings have no endpoints associated with them.
11This shows up in some USB webcams, particularly the Logitech HD 1080p,
12which uses the uvcvideo driver. If a driver switches between two alt
13settings with no endpoints, there is no need to issue a configure endpoint
14command, because there is no endpoint information to update.
15
16The only time a configure endpoint command with just the add slot flag set
17makes sense is when the driver is updating hub characteristics in the slot
18context. However, that code never calls xhci_check_bandwidth, so we
19should be safe not issuing a command if only the slot context add flag is
20set.
21
22Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
24Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
25
26---
27 drivers/usb/host/xhci.c | 6 ++++++
28 1 file changed, 6 insertions(+)
29
30--- a/drivers/usb/host/xhci.c
31+++ b/drivers/usb/host/xhci.c
32@@ -1888,6 +1888,12 @@ int xhci_check_bandwidth(struct usb_hcd
33 ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG);
34 ctrl_ctx->add_flags &= cpu_to_le32(~EP0_FLAG);
35 ctrl_ctx->drop_flags &= cpu_to_le32(~(SLOT_FLAG | EP0_FLAG));
36+
37+ /* Don't issue the command if there's no endpoints to update. */
38+ if (ctrl_ctx->add_flags == cpu_to_le32(SLOT_FLAG) &&
39+ ctrl_ctx->drop_flags == 0)
40+ return 0;
41+
42 xhci_dbg(xhci, "New Input Control Context:\n");
43 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
44 xhci_dbg_ctx(xhci, virt_dev->in_ctx,