From 978e4b16d4b82a0068657213e5aa71fcb0ddd7c2 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Fri, 24 Sep 2010 13:44:15 +0300 Subject: [PATCH] usb: musb: gadget: only enable AUTOCLEAR in double buffered case 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/musb_gadget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 3f1cc5a8381f8..5d815049cbaac 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -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; */ -- 2.39.5