Hi, On Tue, Mar 26, 2013 at 06:15:42PM +0100, Michael Grzeschik wrote: > > > Its not needed to change the ZLT flag before every ep_prime. This patch moves > > > this to the ep_enable and applies it only for non configuration endpoints. > > > > > > Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx> > > > --- > > > Changes since v1: > > > - rebased on the new alignment patch > > > > > > drivers/usb/chipidea/udc.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c > > > index 73ddcc9..53c6c7f 100644 > > > --- a/drivers/usb/chipidea/udc.c > > > +++ b/drivers/usb/chipidea/udc.c > > > @@ -474,7 +474,6 @@ static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq) > > > /* QH configuration */ > > > mEp->qh.ptr->td.next = mReq->dma; /* TERMINATE = 0 */ > > > mEp->qh.ptr->td.token &= ~(TD_STATUS_HALTED|TD_STATUS_ACTIVE); /* clear status */ > > > - mEp->qh.ptr->cap |= QH_ZLT; > > > > > > wmb(); /* synchronize before ep prime */ > > > > > > @@ -1038,6 +1037,8 @@ static int ep_enable(struct usb_ep *ep, > > > mEp->qh.ptr->cap &= ~QH_MULT; > > > else > > > mEp->qh.ptr->cap &= ~QH_ZLT; > > > + if (mEp->num) > > > + mEp->qh.ptr->cap |= QH_ZLT; > > > > looks like this introduces a bug: > > > > 1047 if (mEp->type == USB_ENDPOINT_XFER_CONTROL) > > 1048 mEp->qh.ptr->cap |= QH_IOS; > > 1049 else if (mEp->type == USB_ENDPOINT_XFER_ISOC) > > 1050 mEp->qh.ptr->cap &= ~QH_MULT; > > 1051 else > > 1052 mEp->qh.ptr->cap &= ~QH_ZLT; > > > > so if mEp->num > 0 and mEp->type != CONTROL and mEp->type != ISOC you > > will enable QH_ZLT when you wanted to disable it. > > Thats not right, the above else mEp->qh.ptr->cap &= ~QH_ZLT has > no effect as it got set to zero in the beginning anyway: > > 1015 mEp->qh.ptr->cap = 0; I stand corrected ;-) > The patch "usb: chipidea: udc: rework ep_enable cap setting" > takes care of it and removes that line. alright, thanks Reviewed-by: Felipe Balbi <balbi@xxxxxx> -- balbi
Attachment:
signature.asc
Description: Digital signature