summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-11-18 22:51:18 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-08 10:22:12 -0800
commit41e0b0605826e299a981e2da61e631efe171f4af (patch)
treedbf0d119d260ec3af27a8c4c01609dcb0f388e4f /lib
parent3d57f55a87be678c0e3a91842a3ca2ca4ffcdcaf (diff)
USB: musb_gadget: fix STALL handling
commit cea83241b3a84499c4f9b12f8288f787e7aa6383 upstream. The driver incorrectly cancels the mass-storage device CSW request (which leads to device reset) due to giving back URB at the head of endpoint's queue after sending each STALL handshake; stop doing that and start checking for the queue being non-empty before stalling an endpoint and disallowing stall in such case in musb_gadget_set_halt() like the other gadget drivers do. Moreover, the driver starts Rx request despite of the endpoint being halted -- fix this by moving the SendStall bit check from musb_g_rx() to rxstate(). And we also sometimes get into rxstate() with DMA still active after clearing an endpoint's halt (not clear why), so bail out in this case, similarly to what txstate() does... While at it, also do the following changes : - in musb_gadget_set_halt(), remove pointless Tx FIFO flushing (the driver does not allow stalling with non-empty Tx FIFO anyway); - in rxstate(), stop pointlessly zeroing the 'csr' variable; - in musb_gadget_set_halt(), move the 'done' label to a more proper place; - in musb_g_rx(), eliminate the 'done' label completely... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions