diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-03-26 18:29:19 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-17 10:50:26 -0700 |
commit | 6b6e97107f12f3a9f7b5b43a6c3b94409240bcff (patch) | |
tree | 2ae05da51a4020bf4892c9b2b307583813ffc9a9 /drivers/usb/musb/cppi_dma.c | |
parent | b6e434a5404b9ce8c285ea081b6ea5c523b29db4 (diff) |
USB: musb: fix isochronous TXDMA (take 2)
Multi-frame isochronous TX URBs transfers in DMA mode never
complete with CPPI DMA because musb_host_tx() doesn't restart
DMA on the second frame, only emitting a debug message.
With Inventra DMA they complete, but in PIO mode. To fix:
- Factor out programming of the DMA transfer from
musb_ep_program() into musb_tx_dma_program();
- Reorder the code at the end of musb_host_tx() to
facilitate the fallback to PIO iff DMA fails;
- Handle the buffer offset consistently for both
PIO and DMA modes;
- Add an argument to musb_ep_program() for the same
reason (it only worked correctly with non-zero
offset of the first frame in PIO mode);
- Set the completed isochronous frame descriptor's
'actual_length' and 'status' fields correctly in
DMA mode.
Also, since CPPI reportedly doesn't like sending isochronous
packets in the RNDIS mode, change the criterion for this
mode to be used only for multi-packet transfers. (There's
no need for that mode in the single-packet case anyway.)
[ dbrownell@users.sourceforge.net: split comment paragraph
into bullet list, shrink patch delta, style tweaks ]
Signed-off-by: Pavel Kiryukhin <pkiryukhin@ru.mvista.com>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/cppi_dma.c')
-rw-r--r-- | drivers/usb/musb/cppi_dma.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c index 30e24891ed6..1976e9b4180 100644 --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -579,6 +579,7 @@ cppi_next_tx_segment(struct musb *musb, struct cppi_channel *tx) * trigger the "send a ZLP?" confusion. */ rndis = (maxpacket & 0x3f) == 0 + && length > maxpacket && length < 0xffff && (length % maxpacket) != 0; |