summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/core.h
diff options
context:
space:
mode:
authorAnurag Kumar Vulisha <anuragku@xilinx.com>2018-03-27 16:35:21 +0530
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-05-21 10:00:47 +0300
commitc96e6725db9d6a04ac1bee881e3034b636d9f71c (patch)
tree2c0e37dc8365e01f1cb8dfdf41c172b68e2fbef3 /drivers/usb/dwc3/core.h
parenta31e63b608ff78c77d8e033347239431d522fe5d (diff)
downloadlinux-c96e6725db9d6a04ac1bee881e3034b636d9f71c.tar.bz2
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>
Diffstat (limited to 'drivers/usb/dwc3/core.h')
-rw-r--r--drivers/usb/dwc3/core.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index b6ca898a65d0..ab93d22b6965 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -834,6 +834,7 @@ struct dwc3_hwparams {
* @sg: pointer to first incomplete sg
* @start_sg: pointer to the sg which should be queued next
* @num_pending_sgs: counter to pending sgs
+ * @num_queued_sgs: counter to the number of sgs which already got queued
* @remaining: amount of data remaining
* @epnum: endpoint number to which this request refers
* @trb: pointer to struct dwc3_trb
@@ -852,6 +853,7 @@ struct dwc3_request {
struct scatterlist *start_sg;
unsigned num_pending_sgs;
+ unsigned int num_queued_sgs;
unsigned remaining;
u8 epnum;
struct dwc3_trb *trb;