projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32db3d9
)
usb: dwc3: gadget: Account for link TRB in TRBs left
author
John Youn
<johnyoun@synopsys.com>
Fri, 20 May 2016 00:26:15 +0000
(17:26 -0700)
committer
Felipe Balbi
<felipe.balbi@linux.intel.com>
Mon, 20 Jun 2016 09:32:44 +0000
(12:32 +0300)
The TRBs left calculation didn't account for the link TRB taking up one
spot.
If the trb_dequeue < trb_enqueue, then the result includes the link
TRB slot so it must be adjusted.
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/gadget.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/dwc3/gadget.c
b/drivers/usb/dwc3/gadget.c
index 4dea3e08f95cbd9ac18de690c90341a3dddfce85..3c4fd485431784039399e92a3e6ed28ffc1f6f28 100644
(file)
--- a/
drivers/usb/dwc3/gadget.c
+++ b/
drivers/usb/dwc3/gadget.c
@@
-868,6
+868,9
@@
static u32 dwc3_calc_trbs_left(struct dwc3_ep *dep)
trbs_left = dep->trb_dequeue - dep->trb_enqueue;
trbs_left %= DWC3_TRB_NUM;
+ if (dep->trb_dequeue < dep->trb_enqueue)
+ trbs_left--;
+
return trbs_left;
}