usb: gadget: musb: fix short isoc packets with inventra dma
PATCH v2 1/1 usb: gadget: musb: fix short isoc packets with inventra dma
Quoted 32 lines · Greg Kroah-Hartman
Quoted 24 lines · Bin Liu
From: Paul Elder <[email protected]>
Handling short packets (length < max packet size) in the Inventra DMA engine in the MUSB driver causes the MUSB DMA controller to hang. An example of a problem that is caused by this problem is when streaming video out of a UVC gadget, only the first video frame is transferred.
For short packets (mode-0 or mode-1 DMA),
MUSB_TXCSR_TXPKTRDYmust be set manually by the driver. This was previously done inmusb_g_tx(musb_gadget.c), but incorrectly (all csr flags were cleared, and onlyMUSB_TXCSR_MODEandMUSB_TXCSR_TXPKTRDYwere set). Fixing that problem allows some requests to be transferred correctly, but multiple requests were often put together in one USB packet, and caused problems if the packet size was not a multiple of 4. Instead, setMUSB_TXCSR_TXPKTRDYindma_controller_irq(musbhsdma.c), just like host mode transfers.This topic was originally tackled by Nicolas Boichat [0] [1] and is discussed further at [2] as part of his GSoC project [3].
[0] https://groups.google.com/forum/?hl=en#!topic/beagleboard-gsoc/k8Azwfp75CU
[1] https://gitorious.org/beagleboard-usbsniffer/beagleboard-usbsniffer-kernel/commit/b0be3b6cc195ba732189b04f1d43ec843c3e54c9?p=beagleboard-usbsniffer:beagleboard-usbsniffer-kernel.git;a=patch;h=b0be3b6cc195ba732189b04f1d43ec843c3e54c9
[2] http://beagleboard-usbsniffer.blogspot.com/2010/07/musb-isochronous-transfers-fixed.html
[3] http://elinux.org/BeagleBoard/GSoC/USBSnifferQuoted 6 lines
Fixes 550a7375fe72 ("USB: Add MUSB and TUSB support")Signed-off-by Paul Elder <[email protected]>Signed-off-by Bin Liu <[email protected]>Cc stable <[email protected]>---
v2: add Fixes tag.
Quoted 4 lines
I added a stable tag so that you get notified by my scripts if/when it fails to apply. Otherwise Sasha's scripts are going to try to evaluate it and determine if this needs to be backported or not, and we already know that it does need to be, so let's not waste their time.
Sounds good. Thanks.
I track those musb patches which require manual backport - it doesn't happen very often. But since You and Sasha already have an automation to take care of the tasks, I from now on will add 'cc: stable' whenever applicable and let the scripts to alert me when any action is needed.
Regards,
-Bin.