Skip to contentSkip to conversation

usb: dwc3: gadget: Report isoc scheduled frame number

PATCH New Felipe Balbi 1 participant 1 message Nov 8, 2018 USB

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 usb: dwc3: gadget: Report isoc scheduled frame number

Hi,

Quoted 12 lines · Thinh Nguyen

Report the scheduled frame number of an isochronous request.

---
 drivers/usb/dwc3/gadget.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/dwc3/gadget.c +0 -0
index 679c12e14522..34540b661592 100644

drivers/usb/dwc3/gadget.c static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep, · line 2259

Quoted 6 lines
drivers/usb/dwc3/gadget.c +3 -0
@@ -2254,6 +2254,10 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep,
 	if (chain && (trb->ctrl & DWC3_TRB_CTRL_HWO))
 		trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
 
+	/* Report scheduled frame number for isoc transfers */
+	if (usb_endpoint_xfer_isoc(dep->endpoint.desc))
+		req->request.start_frame = dep->frame_number;

This doesn't work. It'll work fine for the very first TRB. But since we use Update Transfer to add more intervals, I can see that this could lead to wrong frame numbers being reported, no?