Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: gadget: Fix ISO transfer performance

Commit 08a36b543803 ("usb: dwc3: gadget: simplify __dwc3_gadget_ep_queue()")
caused a small change in the way ISO transfer is handled in the case
when XferInProgress event happens on Isoc EP with an active transfer.
This caused a performance degradation of 50%. e.g. using g_webcam on DUT
and luvcview on host the video frame rate dropped from 16fps to 8fps
@high-speed.

Make the ISO transfer handling equivalent to that prior to that commit
to get back the original ISO performance numbers.

Fixes: 08a36b543803 ("usb: dwc3: gadget: simplify __dwc3_gadget_ep_queue()")
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

authored by

Roger Quadros and committed by
Felipe Balbi
f1d6826c 68217959

+11 -1
+11 -1
drivers/usb/dwc3/gadget.c
··· 1261 1261 __dwc3_gadget_start_isoc(dwc, dep, cur_uf); 1262 1262 dep->flags &= ~DWC3_EP_PENDING_REQUEST; 1263 1263 } 1264 + return 0; 1264 1265 } 1265 - return 0; 1266 + 1267 + if ((dep->flags & DWC3_EP_BUSY) && 1268 + !(dep->flags & DWC3_EP_MISSED_ISOC)) { 1269 + WARN_ON_ONCE(!dep->resource_index); 1270 + ret = __dwc3_gadget_kick_transfer(dep, 1271 + dep->resource_index); 1272 + } 1273 + 1274 + goto out; 1266 1275 } 1267 1276 1268 1277 if (!dwc3_calc_trbs_left(dep)) 1269 1278 return 0; 1270 1279 1271 1280 ret = __dwc3_gadget_kick_transfer(dep, 0); 1281 + out: 1272 1282 if (ret == -EBUSY) 1273 1283 ret = 0; 1274 1284