If the non-control endpoints want to halt, but there are pending
requests on this endpoint, we need to return -EAGAIN, otherwise,
the controller may be in stuck if we stall the doolbell'ed
endpoint.
With this change, we could pass the USB certification MSC test.
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
cdns3_select_ep(priv_dev, ep->desc->bEndpointAddress);
if (value) {
+ if (!list_empty(&priv_ep->pending_req_list)) {
+ ret = -EAGAIN;
+ goto finish;
+ }
+
cdns3_ep_stall_flush(priv_ep);
} else {
priv_ep->flags &= ~EP_WEDGE;