UPSTREAM: usb: dwc3: gadget: prepare TRBs on update transfers too
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 12 May 2016 11:08:34 +0000 (14:08 +0300)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
commited60abb5ba3e4338fae2d482f7f488efe24f2a22
treee6c06e52e35e81342c087b6d2f0eb0802a368fe9
parent528a622810ca4c3da1a824d12ae36df3193eb359
UPSTREAM: usb: dwc3: gadget: prepare TRBs on update transfers too

If we're updating transfers, we can also prepare as
many TRBs as we can fit in the ring. Let's start
doing that.

This patch 'solves' a limitation of how many TRBs we
can prepare when we're getting close the end of the
ring. Instead driver to prepare only up to end of
the ring, we check if we have space to wrap around
the ring properly.

Note that this only happens when our enqueue and
dequeue pointers are equal (which is the case for
bulk endpoints after an XferComplete event).

Change-Id: I3a3614061234f2408b39bd3bc235bb2bf5289dff
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit c4233573f6ee611033faa9116fc7003775a450b9)
drivers/usb/dwc3/gadget.c