Re: [PATCH] USB: musb_gadget: fix ZLP sending in musb_g_tx(v1)

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

 



On Thu, 23 Sep 2010, Felipe Balbi wrote:

> On Thu, Sep 23, 2010 at 03:36:40AM -0500, Ming Lei wrote:
> >2010/9/23 Felipe Balbi <balbi@xxxxxx>:
> >> Hi,
> >>
> >> On Wed, Sep 22, 2010 at 10:15:09AM -0500, tom.leiming@xxxxxxxxx wrote:
> >>>
> >>> +               if ((request->zero && request->length
> >>
> >> I think you can actually remove the request->length check, I doubt any
> >> gadget driver will queue a request without length sent to something more
> >> than 0. could you test that please ?

Gadget drivers queue requests with length set to 0 all the time.  How 
else could they send a ZLP?

Maybe they don't also set the request->zero flag, but I wouldn't depend
on it.  Checking is safer.

> >I think so too. But I am not sure, since I don't know why the
> >request->length check is introduced, so I don't remove the check in
> >the patch and just fix the ZLP issue only.

The check is there in order to prevent the controller driver from 
sending _two_ ZLPs when the gadget driver queues a request with 
request.length == 0 and request.zero set.

> >Also seems req->zero is used in some corner case only, I don't think
> >there are good test cases to verify the change of removing the check,
> >right?
> >
> >So suggest to keep the check until we are sure it is safe to remove it.
> 
> makes sense :-) I'll try to play around with removing request->length
> check after merge window then :-)

Even if it never gets used, better safe than sorry.  It's not like this 
test takes up multiple megabytes of code space.

Alan Stern

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