Re: [PATCH 5/5] usb: chipidea: udc: add multiple td support to hardware_{en,de}queue

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

 



On Thu, Mar 07, 2013 at 02:46:23PM +0100, Michael Grzeschik wrote:
> > > > +	mReq->req.actual += reqnodesize;
> > > > +
> > > > +	if (length > TD_COUNT * CI13XXX_PAGE_SIZE) {
> > > > +		int rest = length - mReq->req.actual;
> > > > +		while (rest > 0) {
> > > > +			unsigned count = min(length - mReq->req.actual,
> > > > +						(unsigned)(TD_COUNT * CI13XXX_PAGE_SIZE));
> > > 
> > > You can use rest instead of "length - mReq->req.actual".
> > 
> > Yes, i will fix.
> 
> I realized that its not possible to use rest here, as it is constant
> inside the loop and the routine add_td_to_list is using mReq->req.actual
> as well to keep count of the rest. So this hunk is correct as it is.

Yes, you are right.
> > > >  
> > > > +	mReq->req.actual = 0;
> > > 
> > > Any reasons to do it here? The ep_queue will do it later.
> > 
> > No it was doing it before calling hardware_enqueue. So i change it back
> > here. That indeed seems like we misuse this variable in that code.
> > I will fix this.
> 
> As mentioned above we use this variable internaly. As this
> mReq->req.actual count is used internaly, we have to reset it
> afterwarts. Regarding to this line, this code is correct as it is.
> 

Agree to reset mRep->req.actual to zero after using it.

> 
> -- 
> 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
> 

-- 

Best Regards,
Peter Chen

--
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