RE: [PATCH v2 3/8] usb: dwc3: make controller clear transfer resources after complete

From: Anurag Kumar Vulisha
Date: Wed Sep 05 2018 - 05:21:44 EST



Hi Thinh,

>> + * To issue start transfer on another stream, controller need to free
>> + * previously acquired transfer resource. Setting the LST bit in
>> + * last TRB makes the controller clear transfer resource for that
>> + * endpoint, allowing to start another stream on that endpoint.
>> + */
>> + else if (dep->stream_capable)
>> + trb->ctrl |= DWC3_TRB_CTRL_LST;
>> +
>> if (usb_endpoint_xfer_bulk(dep->endpoint.desc) && dep->stream_capable)
>> trb->ctrl |= DWC3_TRB_CTRL_SID_SOFN(stream_id);
>>
>> @@ -2268,7 +2278,7 @@ static int
>dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep,
>> if (event->status & DEPEVT_STATUS_SHORT && !chain)
>> return 1;
>>
>> - if (event->status & DEPEVT_STATUS_IOC)
>> + if (event->status & (DEPEVT_STATUS_IOC | DEPEVT_STATUS_LST))
>> return 1;
>>
>> return 0;
>> @@ -2457,6 +2467,10 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
>> }
>>
>> switch (event->endpoint_event) {
>> + case DWC3_DEPEVT_XFERCOMPLETE:
>> + if (!dep->stream_capable)
>> + break;
>> + dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
> Add this: /* Falls Through */
Thanks for correcting, will fix it in the next version of patch

Thanks,
Anurag Kumar Vulisha

>> case DWC3_DEPEVT_XFERINPROGRESS:
>> dwc3_gadget_endpoint_transfer_in_progress(dep, event);
>> break;
>> @@ -2472,7 +2486,6 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
>> }
>> break;
>> case DWC3_DEPEVT_STREAMEVT:
>> - case DWC3_DEPEVT_XFERCOMPLETE:
>> case DWC3_DEPEVT_RXTXFIFOEVT:
>> break;
>> }
>
>Thinh