aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2011-05-13 16:10:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-13 19:34:06 -0400
commitb513d44751bfb609a3c20463f764c8ce822d63e9 (patch)
tree3c0db0c5a46540ce6a88bcc0216978907d1ffaec /drivers/usb
parent2efeaeb00f26c13ac14b8d53684a8bbd3c343ce6 (diff)
xhci: Fix full speed bInterval encoding.
Dmitry's patch dfa49c4ad120a784ef1ff0717168aa79f55a483a USB: xhci - fix math in xhci_get_endpoint_interval() introduced a bug. The USB 2.0 spec says that full speed isochronous endpoints' bInterval must be decoded as an exponent to a power of two (e.g. interval = 2^(bInterval - 1)). Full speed interrupt endpoints, on the other hand, don't use exponents, and the interval in frames is encoded straight into bInterval. Dmitry's patch was supposed to fix up the full speed isochronous to parse bInterval as an exponent, but instead it changed the *interrupt* endpoint bInterval decoding. The isochronous endpoint encoding was the same. This caused full speed devices with interrupt endpoints (including mice, hubs, and USB to ethernet devices) to fail under NEC 0.96 xHCI host controllers: [ 100.909818] xhci_hcd 0000:06:00.0: add ep 0x83, slot id 1, new drop flags = 0x0, new add flags = 0x99, new slot info = 0x38100000 [ 100.909821] xhci_hcd 0000:06:00.0: xhci_check_bandwidth called for udev ffff88011f0ea000 ... [ 100.910187] xhci_hcd 0000:06:00.0: ERROR: unexpected command completion code 0x11. [ 100.910190] xhci_hcd 0000:06:00.0: xhci_reset_bandwidth called for udev ffff88011f0ea000 When the interrupt endpoint was added and a Configure Endpoint command was issued to the host, the host controller would return a very odd error message (0x11 means "Slot Not Enabled", which isn't true because the slot was enabled). Probably the host controller was getting very confused with the bad encoding. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Dmitry Torokhov <dtor@vmware.com> Reported-by: Thomas Lindroth <thomas.lindroth@gmail.com> Tested-by: Thomas Lindroth <thomas.lindroth@gmail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/xhci-mem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 04145740686c..6938cc8d848f 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1045,12 +1045,12 @@ static unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
1045 break; 1045 break;
1046 1046
1047 case USB_SPEED_FULL: 1047 case USB_SPEED_FULL:
1048 if (usb_endpoint_xfer_int(&ep->desc)) { 1048 if (usb_endpoint_xfer_isoc(&ep->desc)) {
1049 interval = xhci_parse_exponent_interval(udev, ep); 1049 interval = xhci_parse_exponent_interval(udev, ep);
1050 break; 1050 break;
1051 } 1051 }
1052 /* 1052 /*
1053 * Fall through for isochronous endpoint interval decoding 1053 * Fall through for interrupt endpoint interval decoding
1054 * since it uses the same rules as low speed interrupt 1054 * since it uses the same rules as low speed interrupt
1055 * endpoints. 1055 * endpoints.
1056 */ 1056 */