Re: [PATCH v2 04/12] usb: chipidea: udc: move ZLT flag change to ep_enable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 26, 2013 at 07:09:18PM +0200, Felipe Balbi wrote:
> Hi,
> 
> On Tue, Mar 26, 2013 at 05:58:40PM +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;


The patch "usb: chipidea: udc: rework ep_enable cap setting"
takes care of it and removes that line.

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux