Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-13 Thread Baolin Wang
On 13 October 2016 at 15:54, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> Hi, >> >> On 13 October 2016 at 15:08, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Baolin Wang writes: @@ -1487,10 +1496,22

Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-13 Thread Felipe Balbi
Hi, Baolin Wang writes: > Hi, > > On 13 October 2016 at 15:08, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>> @@ -1487,10 +1496,22 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, >>> int is_on) >>> >>>

Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-13 Thread Baolin Wang
Hi, On 13 October 2016 at 15:08, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> @@ -1487,10 +1496,22 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, >> int is_on) >> >> is_on = !!is_on; >> >> +try_again: >>

Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-13 Thread Felipe Balbi
Hi, Baolin Wang writes: > @@ -1487,10 +1496,22 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, > int is_on) > > is_on = !!is_on; > > +try_again: > spin_lock_irqsave(>lock, flags); > ret = dwc3_gadget_run_stop(dwc, is_on, false); >

[RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-04 Thread Baolin Wang
When we change the USB function with configfs dynamically, we possibly met this situation: one core is doing the control transfer, another core is trying to unregister the USB gadget from userspace, we must wait for completing this control tranfer, or it will hang the controller to set the