]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: introduce dma_channel.rx_packet_done
authorDaniel Mack <zonque@gmail.com>
Mon, 26 May 2014 12:52:38 +0000 (14:52 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 30 Jun 2014 19:26:24 +0000 (14:26 -0500)
commit55d82f89b836787f2c4d9ebbf058cc8e1a2204b6
treece8353d4fb5b51bec3274ad0ad64c70b5db652ec
parent0a11b16b5657d2c57fdcf01b69ae40056b492dbe
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>
drivers/usb/musb/musb_cppi41.c
drivers/usb/musb/musb_dma.h
drivers/usb/musb/musb_host.c