From: Arnaud Mandy <ext-arnaud.2.mandy@xxxxxxxxx> omap3 has a silicon bug where it can't handle dma transfers concurrently, meaning the dma will get stuck if we try to use two different dma channels simultaneously. In order to avoid that bug, let's not allocate more than one dma channel at a time. Signed-off-by: Arnaud Mandy <ext-arnaud.2.mandy@xxxxxxxxx> Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxx> --- drivers/usb/musb/musbhsdma.c | 40 +++++++++++++++++++++++----------------- 1 files changed, 23 insertions(+), 17 deletions(-) diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 5e83f96..9371578 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -79,23 +79,29 @@ static struct dma_channel *dma_channel_allocate(struct dma_controller *c, struct dma_channel *channel = NULL; u8 bit; - for (bit = 0; bit < MUSB_HSDMA_CHANNELS; bit++) { - if (!(controller->used_channels & (1 << bit))) { - controller->used_channels |= (1 << bit); - musb_channel = &(controller->channel[bit]); - musb_channel->controller = controller; - musb_channel->idx = bit; - musb_channel->epnum = hw_ep->epnum; - musb_channel->transmit = transmit; - channel = &(musb_channel->channel); - channel->private_data = musb_channel; - channel->status = MUSB_DMA_STATUS_FREE; - channel->max_len = 0x10000; - /* Tx => mode 1; Rx => mode 0 */ - channel->desired_mode = transmit; - channel->actual_len = 0; - break; - } + /* musb on omap3 has a problem with using dma channels simultaneously + * so we will only allocate 1 dma channel at a time to avoid problems + * related to that bug + */ + for (bit = 0; bit < 1; bit++) { + if (controller->used_channels & (1 << bit)) + continue; + + controller->used_channels |= (1 << bit); + musb_channel = &(controller->channel[bit]); + musb_channel->controller = controller; + musb_channel->idx = bit; + musb_channel->epnum = hw_ep->epnum; + musb_channel->transmit = transmit; + channel = &(musb_channel->channel); + channel->private_data = musb_channel; + channel->status = MUSB_DMA_STATUS_FREE; + channel->max_len = 0x7fffffff; + /* always use mode1 */ + channel->desired_mode = true; + channel->actual_len = 0; + + break; } return channel; -- 1.6.4.2.253.g0b1fac -- 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