]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: xhci: Fix issue with set interface after stall.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Thu, 6 May 2010 20:40:08 +0000 (13:40 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:22:08 +0000 (11:22 -0700)
commit863bbb51075021d09e607a2fe471f7ca702d40cd
treec87aa4a83d9103754fdfbf6154ff537528228b34
parent8adbb24bada99dde60b4d5ebdc2ae1ec61ff4698
USB: xhci: Fix issue with set interface after stall.

commit 1624ae1c19e227096ba85bfc389d9b99cb6f7dde upstream.

When the USB core installs a new interface, it unconditionally clears the
halts on all the endpoints on the new interface.  Usually the xHCI host
needs to know when an endpoint is reset, so it can change its internal
endpoint state.  In this case, it doesn't care, because the endpoints were
never halted in the first place.

To avoid issuing a redundant Reset Endpoint command, the xHCI driver looks
at xhci_virt_ep->stopped_td to determine if the endpoint was actually
halted.  However, the functions that handle the stall never set that
variable to NULL after it dealt with the stall.  So if an endpoint stalled
and a Reset Endpoint command completed, and then the class driver tried to
install a new alternate setting, the xHCI driver would access the old
xhci_virt_ep->stopped_td pointer.  A similar problem occurs if the
endpoint has been stopped to cancel a transfer.

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
drivers/usb/host/xhci.c