]>
Commit | Line | Data |
---|---|---|
6ee55f20 GKH |
1 | From 2dc3753997f3c80ce8b950242ab9bb3fb936acfd Mon Sep 17 00:00:00 2001 |
2 | From: Sarah Sharp <sarah.a.sharp@linux.intel.com> | |
3 | Date: Fri, 2 Sep 2011 11:05:40 -0700 | |
4 | Subject: xhci: If no endpoints changed, don't issue BW command. | |
5 | ||
6 | From: Sarah Sharp <sarah.a.sharp@linux.intel.com> | |
7 | ||
8 | commit 2dc3753997f3c80ce8b950242ab9bb3fb936acfd upstream. | |
9 | ||
10 | Some alternate interface settings have no endpoints associated with them. | |
11 | This shows up in some USB webcams, particularly the Logitech HD 1080p, | |
12 | which uses the uvcvideo driver. If a driver switches between two alt | |
13 | settings with no endpoints, there is no need to issue a configure endpoint | |
14 | command, because there is no endpoint information to update. | |
15 | ||
16 | The only time a configure endpoint command with just the add slot flag set | |
17 | makes sense is when the driver is updating hub characteristics in the slot | |
18 | context. However, that code never calls xhci_check_bandwidth, so we | |
19 | should be safe not issuing a command if only the slot context add flag is | |
20 | set. | |
21 | ||
22 | Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> | |
23 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
24 | Signed-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, |