> -----Original Message----- > From: Gadiyar, Anand > Sent: Wednesday, October 28, 2009 9:16 PM > To: linux-usb@xxxxxxxxxxxxxxx > Cc: Gadiyar, Anand; Felipe Balbi; David Brownell; Gupta, Ajay Kumar > Subject: [PATCH] MUSB: Fix aborted RX-DMA path > > MUSB: Fix aborted RX-DMA path > > In the MUSB rxstate function, if channel_program() returns an > error, then we use PIO mode to carry out that RX transfer. > > For this to work correctly, we need to de-assert DMAENAB in > RXCSR. > > Signed-off-by: Anand Gadiyar <gadiyar@xxxxxx> > Cc: Felipe Balbi <felipe.balbi@xxxxxxxxx> > Cc: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx> > Cc: Ajay Kumar Gupta <ajay.gupta@xxxxxx> Ping? Ajay, Felipe, David, Greg? > --- > (Resending with updated $SUBJECT. Sorry for the noise) > > In current code, this bug is purely academic, since channel_program() > always returns success. However, if it ever failed, then the > fix is needed. We spent some time to debug this when we deliberately > made channel_program fail (to test the PIO path), so I think this > fix is worth having. > > It's probably not required for the stable trees. > > diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c > index 8b3c4e2..cfac24d 100644 > --- a/drivers/usb/musb/musb_gadget.c > +++ b/drivers/usb/musb/musb_gadget.c > @@ -688,8 +688,15 @@ static void rxstate(struct musb *musb, struct musb_request *req) > transfer_size); > } > > - if (use_dma) > + if (use_dma) { > return; > + } else { > + /* Need to clear DMAENAB for the > + * backup PIO mode transfer to work > + */ > + csr &= ~MUSB_RXCSR_DMAENAB; > + musb_writew(epio, MUSB_RXCSR, csr); > + } > } > #endif /* Mentor's DMA */ > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html