提交 c00dd4a6 编写于 作者: G Gregory Herrero 提交者: Felipe Balbi

usb: dwc2: gadget: fix clear halt feature handling

When clearing HALT on an endpoint, req->complete of in progress
requests must be called with locks off. New request should only be
started if there is not already a pending request on the endpoint.
Tested-by: NRobert Baldyga <r.baldyga@samsung.com>
Acked-by: NJohn Youn <johnyoun@synopsys.com>
Signed-off-by: NGregory Herrero <gregory.herrero@intel.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 b46146d5
...@@ -1007,16 +1007,22 @@ static int s3c_hsotg_process_req_feature(struct dwc2_hsotg *hsotg, ...@@ -1007,16 +1007,22 @@ static int s3c_hsotg_process_req_feature(struct dwc2_hsotg *hsotg,
hs_req = ep->req; hs_req = ep->req;
ep->req = NULL; ep->req = NULL;
list_del_init(&hs_req->queue); list_del_init(&hs_req->queue);
usb_gadget_giveback_request(&ep->ep, if (hs_req->req.complete) {
&hs_req->req); spin_unlock(&hsotg->lock);
usb_gadget_giveback_request(
&ep->ep, &hs_req->req);
spin_lock(&hsotg->lock);
}
} }
/* If we have pending request, then start it */ /* If we have pending request, then start it */
restart = !list_empty(&ep->queue); if (!ep->req) {
if (restart) { restart = !list_empty(&ep->queue);
hs_req = get_ep_head(ep); if (restart) {
s3c_hsotg_start_req(hsotg, ep, hs_req = get_ep_head(ep);
hs_req, false); s3c_hsotg_start_req(hsotg, ep,
hs_req, false);
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册