On Tue, 23 Jul 2013, Felipe Balbi wrote:

> > > @@ -148,6 +148,7 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep 
> > > *dep,
> > >  
> > >           direction = !dwc->ep0_expect_in;
> > >           dwc->delayed_status = false;
> > > +         usb_gadget_set_state(&dwc->gadget, USB_STATE_CONFIGURED);
> > 
> > Isn't this overkill?  Do you really want to call usb_gadget_set_state() 
> > every time the gadget driver queues a transfer on ep0?
> > 
> > Or am I missing an important part of the context?
> 
> heh, you're missing context, that will only be called when we had
> delayed status flag set:
> 
> | static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep,
> |             struct dwc3_request *req)
> | {
> 
> [ ... ]
> 
> |     /*
> |      * In case gadget driver asked us to delay the STATUS phase,
> |      * handle it here.
> |      */
> |     if (dwc->delayed_status) {
> |             unsigned        direction;
> | 
> |             direction = !dwc->ep0_expect_in;
> |             dwc->delayed_status = false;
> |             usb_gadget_set_state(&dwc->gadget, USB_STATE_CONFIGURED);

I see.  Doesn't the mass-storage gadget also use delayed status when
going into the _un_configured state?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to