On Mon, Mar 28, 2011 at 05:18, Felipe Balbi wrote: > On Mon, Mar 28, 2011 at 05:06:51AM -0400, Mike Frysinger wrote: >> the musb ip on blackfin parts has an anomaly with DMA mode 1 transmits >> where if the transfer is not a multiple of the maximum packet size, >> the last short packet might be corrupted. Âto work around this issue, >> we transfer the full sized packets using dma mode 1 and then use dma >> mode 0 for the last short packet. >> >> so in common code: >> --- a/drivers/usb/musb/musb_host.c >> +++ b/drivers/usb/musb/musb_host.c >> @@ -672,7 +672,10 @@ static bool musb_tx_dma_program(struct dma_controller *dma, >> Â Â wmb(); >> >> Â Â if (!dma->channel_program(channel, pkt_size, mode, >> - Â Â Â Â Â urb->transfer_dma + offset, length)) { >> + Â Â Â Â Â urb->transfer_dma + offset, >> + Â Â Â Â Â (channel->desired_mode == 0) ? length : >> + Â Â Â Â Â Â Â length - (length % qh->maxpacket))) >> + Â { >> Â Â Â Â dma->channel_release(channel); >> Â Â Â Â hw_ep->tx_channel = NULL; >> >> @@ -1750,7 +1753,10 @@ void musb_host_rx(struct musb *musb, u8 epnum) >> Â Â Â Â Â Â Â*/ >> Â Â Â Â Â Â ret = c->channel_program( >> Â Â Â Â Â Â Â Â dma, qh->maxpacket, >> - Â Â Â Â Â Â Â dma->desired_mode, buf, length); >> + Â Â Â Â Â Â Â dma->desired_mode, buf, >> + Â Â Â Â Â Â Â (dma->desired_mode == 0) >> + Â Â Â Â Â Â Â ? length >> + Â Â Â Â Â Â Â : length - (length % qh->maxpacket)); >> >> Â Â Â Â Â Â if (!ret) { >> Â Â Â Â Â Â Â Â c->channel_release(dma); >> >> any ideas on how to get this workaround merged ? Âanother idea i had >> was that we could add a hook to the top of dma_channel_program to let >> targets muck with the arguments ... the Blackfin code would just need >> to do something like this at the start of the func: >> + Â if (musb_channel->transmit && channel->desired_mode == 1) >> + Â Â Â len = len - (len % packet_sz); > > is that IP-related or Blackfin-only ? I mean, does this bug affects all > MUSB of a particular RTL version or only the Blackfin ones ? our understanding of the issue is that it is Blackfin specific. seems to be related to our internal bus/dma connections to the musb ip. -mike -- 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