Hi, Thinh Nguyen writes: > After a number of unsuccessful start isoc attempts due to bus-expiry > status, issue END_TRANSFER command and retry on the next XferNotReady > event. > > Signed-off-by: Thinh Nguyen > --- > drivers/usb/dwc3/gadget.c | 36 +++++++++++++++++++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index f1aae4615cf1..a5ad02987536 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -1406,7 +1406,8 @@ static int __dwc3_gadget_start_isoc(struct dwc3_ep *dep) > int ret; > int i; > > - if (list_empty(&dep->pending_list)) { > + if (list_empty(&dep->pending_list) && > + list_empty(&dep->started_list)) { > dep->flags |= DWC3_EP_PENDING_REQUEST; > return -EAGAIN; > } > @@ -1429,6 +1430,27 @@ static int __dwc3_gadget_start_isoc(struct dwc3_ep *dep) > break; > } > > + /* > + * After a number of unsuccessful start attempts due to bus-expiry > + * status, issue END_TRANSFER command and retry on the next XferNotReady > + * event. > + */ > + if (ret == -EAGAIN) { > + struct dwc3_gadget_ep_cmd_params params; > + u32 cmd; > + > + cmd = DWC3_DEPCMD_ENDTRANSFER | > + DWC3_DEPCMD_CMDIOC | > + DWC3_DEPCMD_PARAM(dep->resource_index); > + > + dep->resource_index = 0; > + memset(¶ms, 0, sizeof(params)); > + > + ret = dwc3_send_gadget_ep_cmd(dep, cmd, ¶ms); > + if (!ret) > + dep->flags |= DWC3_EP_END_TRANSFER_PENDING; > + } I like this! Pretty good idea :-) I'll wait for your reply to my question on the other patch, then start queueing again. -- balbi