lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <add96b11-ddec-84b9-c17e-6dabe0dd8ffd@synopsys.com>
Date: Fri, 18 Apr 2025 12:25:56 +0000
From: Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
To: Michael Grzeschik <m.grzeschik@...gutronix.de>,
        Minas Harutyunyan <Minas.Harutyunyan@...opsys.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>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: Re: [PATCH] usb: dwc2: also exit clock_gating when stopping udc while
 suspended



On 4/17/25 21:40, Michael Grzeschik wrote:
> It is possible that the gadget will be disabled, while the udc is
> suspended. When enabling the udc in that case, the clock gating
> will not be enabled again. Leaving the phy unclocked. Even when the
> udc is not enabled, connecting this powered but not clocked phy leads
> to enumeration errors on the host side.
> 
> To ensure that the clock gating will be in an valid state, we ensure
> that the clock gating will be enabled before stopping the udc.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@...gutronix.de>

Acked-by: Minas Harutyunyan <hminas@...opsys.com>

> ---
>   drivers/usb/dwc2/gadget.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 300ea4969f0cf..f323fb5597b32 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -4604,6 +4604,12 @@ static int dwc2_hsotg_udc_stop(struct usb_gadget *gadget)
>   	if (!hsotg)
>   		return -ENODEV;
>   
> +	/* Exit clock gating when driver is stopped. */
> +	if (hsotg->params.power_down == DWC2_POWER_DOWN_PARAM_NONE &&
> +	    hsotg->bus_suspended && !hsotg->params.no_clock_gating) {
> +		dwc2_gadget_exit_clock_gating(hsotg, 0);
> +	}
> +
>   	/* all endpoints should be shutdown */
>   	for (ep = 1; ep < hsotg->num_of_eps; ep++) {
>   		if (hsotg->eps_in[ep])
> 
> ---
> base-commit: cfb2e2c57aef75a414c0f18445c7441df5bc13be
> change-id: 20250417-dwc2_clock_gating-579a87fcdf93
> 
> Best regards,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ