Skip to content

Commit

Permalink
usb: dwc3: gadget: reset resource index to zero
Browse files Browse the repository at this point in the history
If we collected two requests together (i.e. only the last of them has
LST=1) then we only have to stop transfer once: The clean-up code will
cleanup everything until first TRB with the LST bit set.
After XferComplete this index should be no longer valid since there is
no transfer pending.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Sebastian Andrzej Siewior authored and Felipe Balbi committed Sep 9, 2011
1 parent 0d2f475 commit a1ae9be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,8 +1366,10 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
status = -ECONNRESET;

clean_busy = dwc3_cleanup_done_reqs(dwc, dep, event, status);
if (clean_busy)
if (clean_busy) {
dep->flags &= ~DWC3_EP_BUSY;
dep->res_trans_idx = 0;
}
}

static void dwc3_gadget_start_isoc(struct dwc3 *dwc,
Expand Down Expand Up @@ -1537,6 +1539,7 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
memset(&params, 0, sizeof(params));
ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
WARN_ON_ONCE(ret);
dep->res_trans_idx = 0;
}
}

Expand Down

0 comments on commit a1ae9be

Please sign in to comment.