Skip to content

Commit

Permalink
usb: musb: gadget: only enable AUTOCLEAR in double buffered case
Browse files Browse the repository at this point in the history
commit 633ba7876b96ec339ef685357e2f7c60b5a8ce85 broke
g_file_storage functionality by enabling AUTOCLEAR on
all cases without caring for all gadget drivers.

This patch will only enable AUTOCLEAR if our endpoint's
FIFO was configured with double buffering support. Note
this is not a complete fix, double buffered case still
doesn't work always, but that hasn't been working for
quite some time. Other than reverting the entire commit
and breaking testusb with double buffered case again,
I decided it was better to fix the single buffered case
and spend more time fixing double buffered case properly.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent e7379aa commit e0c4347
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/musb/musb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,8 @@ static void rxstate(struct musb *musb, struct musb_request *req)
*/

csr |= MUSB_RXCSR_DMAENAB;
if (!musb_ep->hb_mult)
if (!musb_ep->hb_mult &&
musb_ep->hw_ep->rx_double_buffered)
csr |= MUSB_RXCSR_AUTOCLEAR;
#ifdef USE_MODE1
/* csr |= MUSB_RXCSR_DMAMODE; */
Expand Down

0 comments on commit e0c4347

Please sign in to comment.