]> asedeno.scripts.mit.edu Git - linux.git/commit
usb: dwc2: gadget: Adjust ISOC OUT request's actual len for DDMA
authorVahram Aharonyan <vahrama@synopsys.com>
Tue, 15 Nov 2016 03:16:46 +0000 (19:16 -0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 18 Nov 2016 11:54:48 +0000 (13:54 +0200)
commit95d2b0370d3ce21796b98b41d166f6524e3610c6
tree8a5f3451aba4b6142e5812339e7b0992f28a3c98
parentec01f0b231fc7d910c9d4cf9c435c34537925d95
usb: dwc2: gadget: Adjust ISOC OUT request's actual len for DDMA

In DDMA mode if programmed ISOC OUT transfer length is not DWORD
aligned, after closing descriptor HW leaves value of 4 - (ureq->length %
4) in the RX bytes. This is caused because DMA works using 4B chunks.
Example: if length = 9 and all 9 bytes were received from the bus, after
xfercomplete rx_bytes value is 3. Hence add this value to the amount of
transferred bytes.

Signed-off-by: Vahram Aharonyan <vahrama@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/gadget.c