Commit c2df85ca authored by Paul Zimmerman's avatar Paul Zimmerman Committed by Felipe Balbi

usb: dwc3: clear 'res_trans_idx' as soon as it becomes invalid

Transfer resource index is cleared in hardware when XFERCOMPLETE
event is generated, so clear the driver's res_trans_idx variable
immediately after that event is received. The upcoming hibernation
patches depend on this change.
Signed-off-by: default avatarPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 249a4569
...@@ -617,6 +617,7 @@ static void dwc3_ep0_xfer_complete(struct dwc3 *dwc, ...@@ -617,6 +617,7 @@ static void dwc3_ep0_xfer_complete(struct dwc3 *dwc,
struct dwc3_ep *dep = dwc->eps[event->endpoint_number]; struct dwc3_ep *dep = dwc->eps[event->endpoint_number];
dep->flags &= ~DWC3_EP_BUSY; dep->flags &= ~DWC3_EP_BUSY;
dep->res_trans_idx = 0;
dwc->setup_packet_pending = false; dwc->setup_packet_pending = false;
switch (dwc->ep0state) { switch (dwc->ep0state) {
......
...@@ -1628,10 +1628,8 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc, ...@@ -1628,10 +1628,8 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
status = -ECONNRESET; status = -ECONNRESET;
clean_busy = dwc3_cleanup_done_reqs(dwc, dep, event, status); clean_busy = dwc3_cleanup_done_reqs(dwc, dep, event, status);
if (clean_busy) { if (clean_busy)
dep->flags &= ~DWC3_EP_BUSY; dep->flags &= ~DWC3_EP_BUSY;
dep->res_trans_idx = 0;
}
/* /*
* WORKAROUND: This is the 2nd half of U1/U2 -> U0 workaround. * WORKAROUND: This is the 2nd half of U1/U2 -> U0 workaround.
...@@ -1736,6 +1734,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, ...@@ -1736,6 +1734,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
switch (event->endpoint_event) { switch (event->endpoint_event) {
case DWC3_DEPEVT_XFERCOMPLETE: case DWC3_DEPEVT_XFERCOMPLETE:
dep->res_trans_idx = 0;
if (usb_endpoint_xfer_isoc(dep->desc)) { if (usb_endpoint_xfer_isoc(dep->desc)) {
dev_dbg(dwc->dev, "%s is an Isochronous endpoint\n", dev_dbg(dwc->dev, "%s is an Isochronous endpoint\n",
dep->name); dep->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment