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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 15 Feb 2021 12:41:45 -0500
From:   Alan Stern <stern@...land.harvard.edu>
To:     Daehwan Jung <dh10.jung@...sung.com>
Cc:     Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: usb: dwc3: gadget: Change runtime pm function for DWC3 runtime
 suspend

On Mon, Feb 15, 2021 at 11:38:58AM +0900, Daehwan Jung wrote:
> It seems pm_runtime_put calls runtime_idle callback not runtime_suspend callback.

How is this fact related to your patch?

> It's better to use pm_runtime_put_sync_suspend to allow DWC3 runtime suspend.

Why do you think it is better?  The advantage of pm_runtime_put is that 
it allows the suspend to occur at a later time in a workqueue thread, so 
the caller doesn't have to wait for the device to go into suspend.

Alan Stern

> Signed-off-by: Daehwan Jung <dh10.jung@...sung.com>
> ---
>  drivers/usb/dwc3/gadget.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index aebcf8e..4a4b93b 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -2229,7 +2229,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
>  	 */
>  	ret = pm_runtime_get_sync(dwc->dev);
>  	if (!ret || ret < 0) {
> -		pm_runtime_put(dwc->dev);
> +		pm_runtime_put_sync_suspend(dwc->dev);
>  		return 0;
>  	}
>  
> -- 
> 2.7.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ