usb: dwc3: gadget: Correct the logic for queuing sgs
authorAnurag Kumar Vulisha <anuragku@xilinx.com>
Tue, 27 Mar 2018 11:05:21 +0000 (16:35 +0530)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 21 May 2018 07:00:47 +0000 (10:00 +0300)
commitc96e6725db9d6a04ac1bee881e3034b636d9f71c
tree2c0e37dc8365e01f1cb8dfdf41c172b68e2fbef3
parenta31e63b608ff78c77d8e033347239431d522fe5d
usb: dwc3: gadget: Correct the logic for queuing sgs

The present code correctly fetches the req which were previously not
queued from the started_list but fails to continue queuing from the sg
where it previously stopped queuing (because of the unavailable TRB's).
This patch correct's the code to continue queuing from the correct sg
present in the sglist.

For example, consider 5 sgs in req. Because of limited TRB's among the
5 sgs only 3 got queued. This patch corrects the code to start queuing
from correct sg i.e 4th sg when the TRBs are available.

Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/gadget.c