Re: [PATCH v3] usb: dwc3: Stop active transfers before halting the controller

2020-09-25 Thread Wesley Cheng
On 9/24/2020 11:06 PM, Felipe Balbi wrote: > > Hi, > > Alan Stern writes: Hence, the reason if there was already a pending IRQ triggered, the dwc3_gadget_disable_irq() won't ensure the IRQ is handled. We can do something like: if (!is_on)

Re: [PATCH v3] usb: dwc3: Stop active transfers before halting the controller

2020-09-25 Thread Felipe Balbi
Hi, Alan Stern writes: >> > Hence, the reason if there was already a pending IRQ triggered, the >> > dwc3_gadget_disable_irq() won't ensure the IRQ is handled. We can do >> > something like: >> > if (!is_on) >> >dwc3_gadget_disable_irq() >> > synchronize_irq() >> > spin_lock_irqsave() >> >

Re: [PATCH v3] usb: dwc3: Stop active transfers before halting the controller

2020-09-24 Thread Alan Stern
On Thu, Sep 24, 2020 at 10:39:24AM +0300, Felipe Balbi wrote: > >>> + /* > >>> + * Synchronize and disable any further event handling while controller > >>> + * is being enabled/disabled. > >>> + */ > >>> + disable_irq(dwc->irq_gadget); > >> > >> why isn't dwc3_gadget_disable_irq() enough? >

Re: [PATCH v3] usb: dwc3: Stop active transfers before halting the controller

2020-09-24 Thread Felipe Balbi
Hi, Wesley Cheng writes: > On 9/6/2020 11:20 PM, Felipe Balbi wrote: >> >> Hi, >> >> Wesley Cheng writes: >>> diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c >>> index 59f2e8c31bd1..456aa87e8778 100644 >>> --- a/drivers/usb/dwc3/ep0.c >>> +++ b/drivers/usb/dwc3/ep0.c >>> @@

Re: [PATCH v3] usb: dwc3: Stop active transfers before halting the controller

2020-09-08 Thread Wesley Cheng
On 9/6/2020 11:20 PM, Felipe Balbi wrote: > > Hi, > > Wesley Cheng writes: >> diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c >> index 59f2e8c31bd1..456aa87e8778 100644 >> --- a/drivers/usb/dwc3/ep0.c >> +++ b/drivers/usb/dwc3/ep0.c >> @@ -197,7 +197,7 @@ int

Re: [PATCH v3] usb: dwc3: Stop active transfers before halting the controller

2020-09-07 Thread Felipe Balbi
Hi, Wesley Cheng writes: > diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c > index 59f2e8c31bd1..456aa87e8778 100644 > --- a/drivers/usb/dwc3/ep0.c > +++ b/drivers/usb/dwc3/ep0.c > @@ -197,7 +197,7 @@ int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct > usb_request *request, >

Re: [PATCH v3] usb: dwc3: Stop active transfers before halting the controller

2020-09-03 Thread Thinh Nguyen
Wesley Cheng wrote: > In the DWC3 databook, for a device initiated disconnect or bus reset, the > driver is required to send dependxfer commands for any pending transfers. > In addition, before the controller can move to the halted state, the SW > needs to acknowledge any pending events. If the

[PATCH v3] usb: dwc3: Stop active transfers before halting the controller

2020-09-03 Thread Wesley Cheng
In the DWC3 databook, for a device initiated disconnect or bus reset, the driver is required to send dependxfer commands for any pending transfers. In addition, before the controller can move to the halted state, the SW needs to acknowledge any pending events. If the controller is not halted