Hi,
On Fri, Dec 20, 2013 at 04:38:01PM +0900, Anton Tikhomirov wrote:
> > > + /* handle the case where we have to send a zero packet */
> > > + if ((epnum & 1) && ur->zero &&
> > > + (ur->length % ep0->endpoint.maxpacket == 0)) {
> > > + int ret;
> > > +
> > > + ret = dwc3_ep0_start_trans(dwc, epnum, dwc->ctrl_req_addr,
> > 0,
> > > + DWC3_TRBCTL_CONTROL_DATA);
> > > + WARN_ON(ret < 0);
> > > + dwc->ep0_zlp_sent = 1;
> > > + return;
> > > + }
> >
> > note that this causes a slight bug. Code expects to receive a
> > NRDY_STATUS, but we're sending another CONTROL_DATA which means we will
> > receive XFER_COMPLETE_DATA.
>
> Even if ep0_next_event is set to DWC3_EP0_NRDY_STATUS at the beginning of
> this function, in case of ZLP it will be reset back to DWC3_EP0_COMPLETE in
> dwc3_ep0_start_trans(). So there is no mismatch between what code expects
> to receive and actual event. Did I miss something?as I said, it only works today because we don't have anymore XferNotReady for Data Phase, because of a silicon bug we found. It's still a mismatch to have next_event set to NRDY_STATUS when we know it should be EP0_COMPLETE. Please fix that up accordingly, you might need some refactoring first. -- balbi
signature.asc
Description: Digital signature
