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

2013-07-25 Thread Felipe Balbi
On Wed, Jul 24, 2013 at 02:01:27PM -0400, Alan Stern wrote: On Wed, 24 Jul 2013, Felipe Balbi wrote: Hi, On Tue, Jul 23, 2013 at 12:53:53PM -0400, Alan Stern wrote: I see. Doesn't the mass-storage gadget also use delayed status when going into the _un_configured state?

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

2013-07-25 Thread Alan Stern
On Thu, 25 Jul 2013, Felipe Balbi wrote: On Wed, Jul 24, 2013 at 02:01:27PM -0400, Alan Stern wrote: On Wed, 24 Jul 2013, Felipe Balbi wrote: Hi, On Tue, Jul 23, 2013 at 12:53:53PM -0400, Alan Stern wrote: I see. Doesn't the mass-storage gadget also use delayed status when

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

2013-07-24 Thread Felipe Balbi
Hi, On Tue, Jul 23, 2013 at 12:53:53PM -0400, Alan Stern wrote: I see. Doesn't the mass-storage gadget also use delayed status when going into the _un_configured state? no it doesn't, we bail out early if config number is zero, look at composite.c and you'll see in case of

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

2013-07-24 Thread Alan Stern
On Wed, 24 Jul 2013, Felipe Balbi wrote: Hi, On Tue, Jul 23, 2013 at 12:53:53PM -0400, Alan Stern wrote: I see. Doesn't the mass-storage gadget also use delayed status when going into the _un_configured state? no it doesn't, we bail out early if config number is zero, look at

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

2013-07-23 Thread Felipe Balbi
Hi, On Mon, Jul 22, 2013 at 10:55:28AM -0400, Alan Stern wrote: On Mon, 22 Jul 2013, Felipe Balbi wrote: before changing to configured state, we need to wait until gadget driver has had a chance to process the request. In case of USB_GADGET_DELAYED_STATUS, that means we need to

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

2013-07-23 Thread Alan Stern
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

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

2013-07-23 Thread Felipe Balbi
Hi, On Tue, Jul 23, 2013 at 10:06:15AM -0400, Alan Stern wrote: @@ -148,6 +148,7 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep, direction = !dwc-ep0_expect_in; dwc-delayed_status = false; +

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

2013-07-23 Thread Alan Stern
On Tue, 23 Jul 2013, Felipe Balbi wrote: I see. Doesn't the mass-storage gadget also use delayed status when going into the _un_configured state? no it doesn't, we bail out early if config number is zero, look at composite.c and you'll see in case of configuration zero, we just make

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

2013-07-22 Thread Felipe Balbi
before changing to configured state, we need to wait until gadget driver has had a chance to process the request. In case of USB_GADGET_DELAYED_STATUS, that means we need to defer usb_gadget_set_state() until the upcoming usb_ep_queue(). Reported-by: Alan Stern st...@rowland.harvard.edu

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

2013-07-22 Thread Alan Stern
On Mon, 22 Jul 2013, Felipe Balbi wrote: before changing to configured state, we need to wait until gadget driver has had a chance to process the request. In case of USB_GADGET_DELAYED_STATUS, that means we need to defer usb_gadget_set_state() until the upcoming usb_ep_queue().