]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.8.16/usb-dwc3-gadget-set-pcm1-field-of-isochronous-first-trbs.patch
Drop watchdog patch
[thirdparty/kernel/stable-queue.git] / releases / 4.8.16 / usb-dwc3-gadget-set-pcm1-field-of-isochronous-first-trbs.patch
CommitLineData
86ab591e
GKH
1From 6b9018d4c1e5c958625be94a160a5984351d4632 Mon Sep 17 00:00:00 2001
2From: Felipe Balbi <felipe.balbi@linux.intel.com>
3Date: Thu, 22 Sep 2016 11:01:01 +0300
4Subject: usb: dwc3: gadget: set PCM1 field of isochronous-first TRBs
5
6From: Felipe Balbi <felipe.balbi@linux.intel.com>
7
8commit 6b9018d4c1e5c958625be94a160a5984351d4632 upstream.
9
10In case of High-Speed, High-Bandwidth endpoints, we
11need to tell DWC3 that we have more than one packet
12per interval. We do that by setting PCM1 field of
13Isochronous-First TRB.
14
15Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18---
19 drivers/usb/dwc3/gadget.c | 13 +++++++++++--
20 1 file changed, 11 insertions(+), 2 deletions(-)
21
22--- a/drivers/usb/dwc3/gadget.c
23+++ b/drivers/usb/dwc3/gadget.c
24@@ -775,6 +775,9 @@ static void dwc3_prepare_one_trb(struct
25 unsigned length, unsigned last, unsigned chain, unsigned node)
26 {
27 struct dwc3_trb *trb;
28+ struct dwc3 *dwc = dep->dwc;
29+ struct usb_gadget *gadget = &dwc->gadget;
30+ enum usb_device_speed speed = gadget->speed;
31
32 dwc3_trace(trace_dwc3_gadget, "%s: req %p dma %08llx length %d%s%s",
33 dep->name, req, (unsigned long long) dma,
34@@ -804,10 +807,16 @@ static void dwc3_prepare_one_trb(struct
35 break;
36
37 case USB_ENDPOINT_XFER_ISOC:
38- if (!node)
39+ if (!node) {
40 trb->ctrl = DWC3_TRBCTL_ISOCHRONOUS_FIRST;
41- else
42+
43+ if (speed == USB_SPEED_HIGH) {
44+ struct usb_ep *ep = &dep->endpoint;
45+ trb->size |= DWC3_TRB_SIZE_PCM1(ep->mult - 1);
46+ }
47+ } else {
48 trb->ctrl = DWC3_TRBCTL_ISOCHRONOUS;
49+ }
50
51 /* always enable Interrupt on Missed ISOC */
52 trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI;