summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohn Youn <John.Youn@synopsys.com>2017-01-26 11:58:40 -0800
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-04-11 10:58:19 +0300
commitaf771d731b8e31e6c5aced2b1b066edd16106a6f (patch)
treeabeafe98a8ea0fc7e4e4265e7a8fa120e0d8c9f1 /drivers/usb
parent3a932b0f50f4c0782a27a257b7557f8b928299b2 (diff)
usb: dwc3: gadget: Fix starting microframe for ISOC
The gadget wants to set the starting microframe for the first ISOC TRB to 4 microframes in the future, but it does so by multiplying the dep->interval. This only works if dep->interval = 1. For other intervals it will put it 4 *intervals* in the future which may be way too much. Fix so that it always adds just one interval or at least 4 microframes. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/gadget.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 1a90877f8b96..640e4aa5482d 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1184,8 +1184,11 @@ static void __dwc3_gadget_start_isoc(struct dwc3 *dwc,
return;
}
- /* 4 micro frames in the future */
- uf = cur_uf + dep->interval * 4;
+ /*
+ * Schedule the first trb for one interval in the future or at
+ * least 4 microframes.
+ */
+ uf = cur_uf + max_t(u32, 4, dep->interval);
__dwc3_gadget_kick_transfer(dep, uf);
}