On Wed, Dec 23, 2009 Robert Jarzmik wrote: > > --- a/drivers/usb/gadget/pxa27x_udc.c > > +++ b/drivers/usb/gadget/pxa27x_udc.c > > @@ -1195,7 +1195,7 @@ static int pxa_ep_queue(struct usb_ep *_ > > ep0_end_in_req(ep, req); > > break; > > case OUT_DATA_STAGE: > > - if ((length == 0) || !epout_has_pkt(ep)) > > + if ((length == 0) || epout_has_pkt(ep)) > > if (read_ep0_fifo(ep, req)) > > ep0_end_out_req(ep, req); > > break; > > OK for the code patch. I will make a test with usbtest/g_zero to be sure. > > Would you mind describing before the patch what that improves (ie. if I'm > not > mistaken the out data stage), and in which case you've seen the broken > behaviour ? Do you have a testcase where the Setup is not properly done > because > of that bug ? > > I was thinking that usbtest and g_zero would have caught that case, but it > might > be a corner case I'm not thinking properly about. No, there was no broken behavior to be seen. This is only a minor patch. There is no sense to call read_ep0_fifo(), when no packet is ready. The function will complete, and do nothing. There will be no big error to catch, because read_ep0_fifo() will be called again later, when the next interrupt comes in. Only, if the function pxa_ep_queue() adds a request for endpoint 0, it checks, if the request can be handled immediately, and this is, for a read request, when 0 bytes shall be read, or a packet is waiting to be read. It's probably a writing mistake in the code. Best Regards. ---------------------------------- Schluss mit teuer - her mit den Schnäppchen! Jetzt alle Discounter-Angebote von Aldi über Douglas bis Schlecker übersichtlich für Sie geordnet - jetzt klicken und sparen! http://www.arcor.de/rd/footer.discounto -- 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