[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46125d28-b065-b882-8a62-9d494b271755@synopsys.com>
Date: Tue, 14 Dec 2021 06:22:35 +0000
From: Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
To: Amelie Delaunay <amelie.delaunay@...s.st.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
Fabrice Gasnier <fabrice.gasnier@...s.st.com>
Subject: Re: [PATCH 1/1] usb: dwc2: gadget: don't try to disable ep0 in
dwc2_hsotg_suspend
Hi Amelie,
On 12/7/2021 5:01 PM, Amelie Delaunay wrote:
> Calling dwc2_hsotg_ep_disable on ep0 (in/out) will lead to the following
> logs before returning -EINVAL:
> dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
> dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
>
This messages printed for EP0 OUT which can't be disabled, but EP0 IN
can and should be disabled. Your patch exclude EP0 IN from disabling flow.
Thanks,
Minas
> To avoid these two logs while suspending, start disabling the endpoint
> from the index 1, as done in dwc2_hsotg_udc_stop:
>
> /* all endpoints should be shutdown */
> for (ep = 1; ep < hsotg->num_of_eps; ep++) {
> if (hsotg->eps_in[ep])
> dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep);
> if (hsotg->eps_out[ep])
> dwc2_hsotg_ep_disable_lock(&hsotg->eps_out[ep]->ep);
> }
>
> Signed-off-by: Amelie Delaunay <amelie.delaunay@...s.st.com>
> ---
> drivers/usb/dwc2/gadget.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index b884a83b26a6..ee31f9a328da 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -5086,7 +5086,7 @@ int dwc2_hsotg_suspend(struct dwc2_hsotg *hsotg)
> hsotg->gadget.speed = USB_SPEED_UNKNOWN;
> spin_unlock_irqrestore(&hsotg->lock, flags);
>
> - for (ep = 0; ep < hsotg->num_of_eps; ep++) {
> + for (ep = 1; ep < hsotg->num_of_eps; ep++) {
> if (hsotg->eps_in[ep])
> dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep);
> if (hsotg->eps_out[ep])
Powered by blists - more mailing lists