Hello, I wrote:

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 checking 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()'s 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...

Oops, got distracted and forgot to hange the summary. It should read: musb_hadget: fix STALL handling. :-/

WBR, Sergei



_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to