summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_host.c
diff options
context:
space:
mode:
authorDaniel Mack2014-05-26 14:52:38 +0200
committerFelipe Balbi2014-06-30 21:26:24 +0200
commitff3fcac949187d98684aaf3f1c35c7cae7712649 (patch)
treece8353d4fb5b51bec3274ad0ad64c70b5db652ec /drivers/usb/musb/musb_host.c
parentusb: musb: fix bit mask for CSR in musb_h_tx_flush_fifo() (diff)
downloadkernel-qcow2-linux-ff3fcac949187d98684aaf3f1c35c7cae7712649.tar.gz
kernel-qcow2-linux-ff3fcac949187d98684aaf3f1c35c7cae7712649.tar.xz
kernel-qcow2-linux-ff3fcac949187d98684aaf3f1c35c7cae7712649.zip
usb: musb: introduce dma_channel.rx_packet_done
The musb/cppi41 glue layer is capable of handling transactions that span over more than one USB packet by reloading the DMA descriptors partially. An urb is considered completed when either its transfer buffer has been filled entirely (actual_length == transfer_buffer_length) or if a packet in the stream has less bytes than the endpoint's wMaxPacketSize. Once one of the above conditions is met, musb_dma_completion() is called from cppi41_trans_done(). However, the final decision whether or not to return the urb to its owner is made by the core and its determination of the variable 'done' in musb_host_rx(). This code has currently no way of knowing what the size of the last packet was, and whether or not to give back the urb due to a short read. Fix this by introducing a new boolean flag in 'struct dma_channel', and set it from musb_cppi41.c. If set, it will make the core do what the DMA layer decided and complete the urb. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: George Cherian <george.cherian@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_host.c')
-rw-r--r--drivers/usb/musb/musb_host.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 3381fa56db29..88435cd7fe3d 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1737,7 +1737,8 @@ void musb_host_rx(struct musb *musb, u8 epnum)
/* done if urb buffer is full or short packet is recd */
done = (urb->actual_length + xfer_len >=
urb->transfer_buffer_length
- || dma->actual_len < qh->maxpacket);
+ || dma->actual_len < qh->maxpacket
+ || dma->rx_packet_done);
}
/* send IN token for next packet, without AUTOREQ */