Hi,

On 31 January 2017 at 22:09, Tomasz Medrek
<[email protected]> wrote:
> From: Chuansheng Liu <[email protected]>
>
> Currently, in "for (epnum = 2; epnum < DWC3_ENDPOINTS_NUM; epnum++)",
> it is waiting the DWC3_EP_END_TRANSFER_PENDING flag to be 0 which is
> cleared in dwc3_endpoint_interrupt(). However, before that,the dwc3 irq
> was disabled which reasult this flag will not be cleared.

Not true, we just masked the interrupts described in DEVTEN register,
and we did not disable the endpoint command complete event after
issuing __dwc3_gadget_stop(), thus no need to change.

Could you check the previous discussion through below thread:
https://lkml.org/lkml/2016/10/12/163

>
> This patch moves "for (epnum = 2; epnum < DWC3_ENDPOINTS_NUM; epnum++)"
> ahead of "dwc3_gadget_disable_irq(dwc)" to fix this case.
>
> Signed-off-by: Chuansheng Liu <[email protected]>
> Signed-off-by: Zhen Han <[email protected]>
> ---
>  drivers/usb/dwc3/gadget.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 725b13a..d87825f 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1845,8 +1845,6 @@ static int dwc3_gadget_stop(struct usb_gadget *g)
>         if (pm_runtime_suspended(dwc->dev))
>                 goto out;
>
> -       __dwc3_gadget_stop(dwc);
> -
>         for (epnum = 2; epnum < DWC3_ENDPOINTS_NUM; epnum++) {
>                 struct dwc3_ep  *dep = dwc->eps[epnum];
>
> @@ -1861,6 +1859,8 @@ static int dwc3_gadget_stop(struct usb_gadget *g)
>                                     dwc->lock);
>         }
>
> +       __dwc3_gadget_stop(dwc);
> +
>  out:
>         dwc->gadget_driver      = NULL;
>         spin_unlock_irqrestore(&dwc->lock, flags);
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Baolin.wang
Best Regards
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to