diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-11-18 22:51:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-11-30 16:43:15 -0800 |
commit | cea83241b3a84499c4f9b12f8288f787e7aa6383 (patch) | |
tree | 3d26ab1e85646b401d80677fd45d847ab3fe9261 /drivers/macintosh/windfarm_pm121.c | |
parent | c2f6595fbdb408d3d6850cfae590c8fa93e27399 (diff) |
USB: musb_gadget: fix STALL handling
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>
Cc: <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/macintosh/windfarm_pm121.c')
0 files changed, 0 insertions, 0 deletions