linux/drivers/usb/musb
Paul Elder c418fd6c01 usb: gadget: musb: fix short isoc packets with inventra dma
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?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/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-01-30 15:48:10 +01:00
..
Kconfig
Makefile
am35x.c usb: musb: remove references to default_a of struct usb_otg 2018-05-22 12:03:25 +02:00
cppi_dma.c
cppi_dma.h
da8xx.c usb: musb: remove an unused variable 2018-05-31 12:44:39 +02:00
davinci.c usb: musb: remove references to default_a of struct usb_otg 2018-05-22 12:03:25 +02:00
davinci.h
jz4740.c
musb_am335x.c
musb_core.c USB: musb: clean up debugfs file and directory creation 2018-05-31 12:54:21 +02:00
musb_core.h usb: musb: remove duplicated port mode enum 2018-05-22 12:03:25 +02:00
musb_cppi41.c usb: musb: remove duplicated quirks flag 2018-05-22 12:03:24 +02:00
musb_debug.h USB: musb: clean up debugfs file and directory creation 2018-05-31 12:54:21 +02:00
musb_debugfs.c USB: musb: clean up debugfs file and directory creation 2018-05-31 12:54:21 +02:00
musb_dma.h usb: musb: remove duplicated quirks flag 2018-05-22 12:03:24 +02:00
musb_dsps.c usb: musb: dsps: fix runtime pm for peripheral mode 2018-12-18 15:46:31 +01:00
musb_gadget.c usb: gadget: musb: fix short isoc packets with inventra dma 2019-01-30 15:48:10 +01:00
musb_gadget.h usb: musb: gadget: fix to_musb_ep() to not return NULL 2018-05-22 12:03:25 +02:00
musb_gadget_ep0.c
musb_host.c USB: musb: mark expected switch fall-throughs 2018-07-02 18:08:19 +02:00
musb_host.h usb: musb: fix remote wakeup racing with suspend 2018-05-14 17:04:06 +02:00
musb_io.h usb: musb: remove duplicated quirks flag 2018-05-22 12:03:24 +02:00
musb_regs.h usb: musb: remove some register access wrapper functions 2018-05-22 12:03:24 +02:00
musb_trace.c
musb_trace.h
musb_virthub.c usb: musb: remove duplicated port mode enum 2018-05-22 12:03:25 +02:00
musbhsdma.c usb: gadget: musb: fix short isoc packets with inventra dma 2019-01-30 15:48:10 +01:00
omap2430.c usb: musb: remove references to default_a of struct usb_otg 2018-05-22 12:03:25 +02:00
omap2430.h
sunxi.c usb: musb: remove references to default_a of struct usb_otg 2018-05-22 12:03:25 +02:00
tusb6010.c
tusb6010.h
tusb6010_omap.c
ux500.c usb: musb: remove references to default_a of struct usb_otg 2018-05-22 12:03:25 +02:00
ux500_dma.c