]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: Fix encoding for HS bulk/control NAK rate.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 13 Feb 2012 22:42:11 +0000 (14:42 -0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 21 Feb 2012 23:48:46 +0000 (15:48 -0800)
commitfb0264eaacb05725061a7e007a77981bd7061d30
tree304eb27f688f4420ce82b5689a1f1e74aab4ae0f
parent2957e7ca9036857ade839121a9a0a558577bb46d
xhci: Fix encoding for HS bulk/control NAK rate.

The xHCI 0.96 spec says that HS bulk and control endpoint NAK rate must
be encoded as an exponent of two number of microframes.  The endpoint
descriptor has the NAK rate encoded in number of microframes.  We were
just copying the value from the endpoint descriptor into the endpoint
context interval field, which was not correct.  This lead to the VIA
host rejecting the add of a bulk OUT endpoint from any USB 2.0 mass
storage device.

The fix is to use the correct encoding.  Refactor the code to convert
number of frames to an exponential number of microframes, and make sure
we convert the number of microframes in HS bulk and control endpoints to
an exponent.

This should be back ported to kernels as old as 2.6.31, that contain the
commit 9e0580a0fa58f79676c6e577cd853ecbac6fb547 "USB: xhci - fix math
in xhci_get_endpoint_interval"

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Felipe Contreras <felipe.contreras@gmail.com>
Suggested-by: Andiry Xu <andiry.xu@amd.com>
Cc: stable@vger.kernel.org
drivers/usb/host/xhci-mem.c