Re: [PATCH 2/2] usb: dwc3: ep0: don't change to configured state too early

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

 



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