]> asedeno.scripts.mit.edu Git - linux.git/commit
usb:cdns3 Fix for stuck packets in on-chip OUT buffer.
authorPawel Laszczak <pawell@cadence.com>
Tue, 2 Jul 2019 13:38:02 +0000 (14:38 +0100)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 3 Jul 2019 07:46:07 +0000 (10:46 +0300)
commit573aff747ee350a0541c3a24cacd92a286fb9522
treeb7168480b4b7254e7ca20650c39d4c373803c70e
parent8bc1901ca7b07d864fca11461b3875b31f949765
usb:cdns3 Fix for stuck packets in on-chip OUT buffer.

Controller for OUT endpoints has shared on-chip buffers for all incoming
packets, including ep0out. It's FIFO buffer, so packets must be handled
by DMA in correct order. If the first packet in the buffer will not be
handled, then the following packets directed for other endpoints and
functions will be blocked.

Additionally the packets directed to one endpoint can block entire on-chip
buffers. In this case transfer to other endpoints also will blocked.

To resolve this issue after raising the descriptor missing interrupt
driver prepares internal usb_request object and use it to arm DMA
transfer.

The problematic situation was observed in case when endpoint has
been enabled but no usb_request were queued. Driver try detects
such endpoints and will use this workaround only for these endpoint.

Driver use limited number of buffer. This number can be set by macro
CDNS_WA2_NUM_BUFFERS.

Such blocking situation was observed on ACM gadget. For this function
host send OUT data packet but ACM function is not prepared for
this packet. It's cause that buffer placed in on chip memory block
transfer to other endpoints.

Issue has been fixed for DEV_VER_V2 version of controller.

Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/cdns3/gadget.c
drivers/usb/cdns3/gadget.h