USB: xhci: Handle stalled control endpoints.
commite1edf432ef2f2a997cfe026f05135a0162eb589c
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 7 Aug 2009 21:04:52 +0000 (7 14:04 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:32:47 +0000 (5 09:32 -0700)
tree2be46b0d9e920c580fbbb210bb2ab7858b63c551
parent2f670d465897b491da0b82fd8b047b9ec75bf8c8
USB: xhci: Handle stalled control endpoints.

commit 82d1009f537c2a43be0a410abd33521f76ee3a5a upstream.

When a control endpoint stalls, the next control transfer will clear the
stall.  The USB core doesn't call down to the host controller driver's
endpoint_reset() method when control endpoints stall, so the xHCI driver
has to do all its stall handling for internal state in its interrupt handler.

When the host stalls on a control endpoint, it may stop on the data phase
or status phase of the control transfer.  Like other stalled endpoints,
the xHCI driver needs to queue a Reset Endpoint command and move the
hardware's control endpoint ring dequeue pointer past the failed control
transfer (with a Set TR Dequeue Pointer or a Configure Endpoint command).

Since the USB core doesn't call usb_hcd_reset_endpoint() for control
endpoints, we need to do this in interrupt context when we get notified of
the stalled transfer.  URBs may be queued to the hardware before these two
commands complete.  The endpoint queue will be restarted once both
commands complete.

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