linux-stable/drivers/usb/musb
Paul Elder f8b500d109 usb: gadget: musb: fix short isoc packets with inventra dma
commit c418fd6c01 upstream.

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_TXPKTRDY must be
set manually by the driver. This was previously done in musb_g_tx
(musb_gadget.c), but incorrectly (all csr flags were cleared, and only
MUSB_TXCSR_MODE and MUSB_TXCSR_TXPKTRDY were 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, set MUSB_TXCSR_TXPKTRDY
in dma_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] b0be3b6cc1: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/USBSniffer

Fixes: 550a7375fe ("USB: Add MUSB and TUSB support")
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-12 19:46:12 +01:00
..
am35x.c
blackfin.c
blackfin.h
cppi_dma.c
cppi_dma.h
da8xx.c
davinci.c
davinci.h
jz4740.c
Kconfig
Makefile
musb_am335x.c
musb_core.c usb: musb: Fix external abort in musb_remove on omap2430 2018-04-26 11:02:03 +02:00
musb_core.h
musb_cppi41.c
musb_debug.h
musb_debugfs.c
musb_dma.h
musb_dsps.c usb: musb: dsps: fix otg state machine 2019-02-12 19:46:05 +01:00
musb_gadget.c usb: gadget: musb: fix short isoc packets with inventra dma 2019-02-12 19:46:12 +01:00
musb_gadget.h
musb_gadget_ep0.c
musb_host.c usb: musb: fix remote wakeup racing with suspend 2018-06-21 04:02:59 +09:00
musb_host.h usb: musb: fix remote wakeup racing with suspend 2018-06-21 04:02:59 +09:00
musb_io.h
musb_regs.h
musb_trace.c
musb_trace.h
musb_virthub.c usb: musb: fix remote wakeup racing with suspend 2018-06-21 04:02:59 +09:00
musbhsdma.c usb: gadget: musb: fix short isoc packets with inventra dma 2019-02-12 19:46:12 +01:00
musbhsdma.h
omap2430.c
omap2430.h
sunxi.c
tusb6010.c
tusb6010.h
tusb6010_omap.c
ux500.c
ux500_dma.c