aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_host.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 75aa01e0036d..7295e316bdfc 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -837,33 +837,28 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
837 /* kick things off */ 837 /* kick things off */
838 838
839 if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) { 839 if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) {
840 /* candidate for DMA */ 840 /* Candidate for DMA */
841 if (dma_channel) { 841 dma_channel->actual_len = 0L;
842 dma_channel->actual_len = 0L; 842 qh->segsize = len;
843 qh->segsize = len; 843
844 844 /* AUTOREQ is in a DMA register */
845 /* AUTOREQ is in a DMA register */ 845 musb_writew(hw_ep->regs, MUSB_RXCSR, csr);
846 musb_writew(hw_ep->regs, MUSB_RXCSR, csr); 846 csr = musb_readw(hw_ep->regs, MUSB_RXCSR);
847 csr = musb_readw(hw_ep->regs, 847
848 MUSB_RXCSR); 848 /*
849 849 * Unless caller treats short RX transfers as
850 /* unless caller treats short rx transfers as 850 * errors, we dare not queue multiple transfers.
851 * errors, we dare not queue multiple transfers. 851 */
852 */ 852 dma_ok = dma_controller->channel_program(dma_channel,
853 dma_ok = dma_controller->channel_program( 853 packet_sz, !(urb->transfer_flags &
854 dma_channel, packet_sz, 854 URB_SHORT_NOT_OK),
855 !(urb->transfer_flags 855 urb->transfer_dma + offset,
856 & URB_SHORT_NOT_OK), 856 qh->segsize);
857 urb->transfer_dma + offset, 857 if (!dma_ok) {
858 qh->segsize); 858 dma_controller->channel_release(dma_channel);
859 if (!dma_ok) { 859 hw_ep->rx_channel = dma_channel = NULL;
860 dma_controller->channel_release( 860 } else
861 dma_channel); 861 csr |= MUSB_RXCSR_DMAENAB;
862 hw_ep->rx_channel = NULL;
863 dma_channel = NULL;
864 } else
865 csr |= MUSB_RXCSR_DMAENAB;
866 }
867 } 862 }
868 863
869 csr |= MUSB_RXCSR_H_REQPKT; 864 csr |= MUSB_RXCSR_H_REQPKT;