diff --git a/drivers/usb/cdns3/ep0.c b/drivers/usb/cdns3/ep0.c index 09ab1a87a267..f52daad03f32 100644 --- a/drivers/usb/cdns3/ep0.c +++ b/drivers/usb/cdns3/ep0.c @@ -387,6 +387,8 @@ static int cdns3_ep0_feature_handle_endpoint(struct cdns3_device *priv_dev, priv_ep->flags |= EP_STALL; } else { struct usb_request *request; + struct cdns3_request *priv_req; + struct cdns3_trb *trb; if (priv_dev->eps[index]->flags & EP_WEDGE) { cdns3_select_ep(priv_dev, 0x00); @@ -396,6 +398,13 @@ static int cdns3_ep0_feature_handle_endpoint(struct cdns3_device *priv_dev, cdns3_dbg(priv_ep->cdns3_dev, "Clear Stalled endpoint %s\n", priv_ep->name); + request = cdns3_next_request(&priv_ep->pending_req_list); + if (request) { + priv_req = to_cdns3_request(request); + trb = priv_req->trb; + trb->control = trb->control ^ TRB_CYCLE; + } + writel(EP_CMD_CSTALL | EP_CMD_EPRST, &priv_dev->regs->ep_cmd); /* wait for EPRST cleared */ @@ -406,11 +415,10 @@ static int cdns3_ep0_feature_handle_endpoint(struct cdns3_device *priv_dev, priv_ep->flags &= ~EP_STALL; - request = cdns3_next_request(&priv_ep->pending_req_list); if (request) { cdns3_dbg(priv_ep->cdns3_dev, "Resume transfer for %s\n", priv_ep->name); - + trb->control = trb->control ^ TRB_CYCLE; cdns3_rearm_transfer(priv_ep, 1); } }