aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-01-04 17:29:18 -0500
committerBrad Figg <brad.figg@canonical.com>2012-01-23 18:36:37 -0500
commit99fcf16654cd8794ce159a137944294a85240e43 (patch)
treef034421be073fc42b31620f82f08cb333262963e /drivers/usb/host
parent23d14236d028d6bc69c861935d1405c46075d121 (diff)
xhci: Properly handle COMP_2ND_BW_ERR
BugLink: http://bugs.launchpad.net/bugs/915926 commit 71d85724bdd947a3b42a88d08af79f290a1a767b upstream. I encountered a result of COMP_2ND_BW_ERR while improving how the pwc webcam driver handles not having the full usb1 bandwidth available to itself. I created the following test setup, a NEC xhci controller with a single TT USB 2 hub plugged into it, with a usb keyboard and a pwc webcam plugged into the usb2 hub. This caused the following to show up in dmesg when trying to stream from the pwc camera at its highest alt setting: xhci_hcd 0000:01:00.0: ERROR: unexpected command completion code 0x23. usb 6-2.1: Not enough bandwidth for altsetting 9 And usb_set_interface returned -EINVAL, which caused my pwc code to not do the right thing as it expected -ENOSPC. This patch makes the xhci driver properly handle COMP_2ND_BW_ERR and makes usb_set_interface return -ENOSPC as expected. This should be backported to stable kernels as old as 2.6.32. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> Signed-off-by: Brad Figg <brad.figg@canonical.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci.c1
-rw-r--r--drivers/usb/host/xhci.h1
2 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 221f14e1fdd..b880e546d88 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1568,6 +1568,7 @@ static int xhci_configure_endpoint_result(struct xhci_hcd *xhci,
1568 /* FIXME: can we allocate more resources for the HC? */ 1568 /* FIXME: can we allocate more resources for the HC? */
1569 break; 1569 break;
1570 case COMP_BW_ERR: 1570 case COMP_BW_ERR:
1571 case COMP_2ND_BW_ERR:
1571 dev_warn(&udev->dev, "Not enough bandwidth " 1572 dev_warn(&udev->dev, "Not enough bandwidth "
1572 "for new device state.\n"); 1573 "for new device state.\n");
1573 ret = -ENOSPC; 1574 ret = -ENOSPC;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 49ce76c6b41..3e7c3a6c0fb 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -900,7 +900,6 @@ struct xhci_transfer_event {
900/* Invalid Stream ID Error */ 900/* Invalid Stream ID Error */
901#define COMP_STRID_ERR 34 901#define COMP_STRID_ERR 34
902/* Secondary Bandwidth Error - may be returned by a Configure Endpoint cmd */ 902/* Secondary Bandwidth Error - may be returned by a Configure Endpoint cmd */
903/* FIXME - check for this */
904#define COMP_2ND_BW_ERR 35 903#define COMP_2ND_BW_ERR 35
905/* Split Transaction Error */ 904/* Split Transaction Error */
906#define COMP_SPLIT_ERR 36 905#define COMP_SPLIT_ERR 36