USB: xhci: Handle errors that cause endpoint halts.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Wed, 11 Nov 2009 18:28:44 +0000 (10:28 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 19:55:23 +0000 (11:55 -0800)
commitbcef3fd57019e5fc0c8df402b040a52826422a4b
treeab98ded86bd3bcfc2f03629d421bcdfd8462c13a
parent5ad6a529c28db36010ec56c5ee8120addc712b51
USB: xhci: Handle errors that cause endpoint halts.

The xHCI 0.95 and 0.96 specification defines several transfer buffer
request completion codes that indicate a USB transaction error occurred.
When a stall, babble, transaction, or split transaction error completion code
is set, the xHCI has halted that endpoint ring.  Software must issue a
Reset Endpoint command and a Set Transfer Ring Dequeue Pointer command
to clean up the halted ring.

The USB device driver is supposed to call into usb_reset_endpoint() when
an endpoint stalls.  That calls into the xHCI driver to issue the proper
commands.  However, drivers don't call that function for the other
errors that cause the xHC to halt the endpoint ring.  If a babble,
transaction, or split transaction error occurs, check if the endpoint
context reports a halted condition, and clean up the endpoint ring if it
does.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/xhci-ring.c