public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Daehwan Jung <dh10.jung@samsung.com>,
	Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: usb: dwc3: gadget: Change runtime pm function for DWC3 runtime suspend
Date: Mon, 15 Feb 2021 10:54:48 +0300	[thread overview]
Message-ID: <b7d4174f-e441-58a6-25ee-fb89dd78844f@gmail.com> (raw)
In-Reply-To: <1613356739-91734-1-git-send-email-dh10.jung@samsung.com>

Hello!

On 15.02.2021 5:38, Daehwan Jung wrote:

> It seems pm_runtime_put calls runtime_idle callback not runtime_suspend callback.
> It's better to use pm_runtime_put_sync_suspend to allow DWC3 runtime suspend.
> 
> Signed-off-by: Daehwan Jung <dh10.jung@samsung.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) {

    BTW, this can be shortened to (ret <= 0)...

> -		pm_runtime_put(dwc->dev);
> +		pm_runtime_put_sync_suspend(dwc->dev);
>   		return 0;
>   	}
>   

MBR, Sergei

  reply	other threads:[~2021-02-15  7:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210215025057epcas2p205c3c283a8806d818d71f90c872c6e51@epcas2p2.samsung.com>
2021-02-15  2:38 ` usb: dwc3: gadget: Change runtime pm function for DWC3 runtime suspend Daehwan Jung
2021-02-15  7:54   ` Sergei Shtylyov [this message]
2021-02-15 17:41   ` Alan Stern
2021-02-16  1:30     ` Jung Daehwan
2021-02-16 15:31       ` Alan Stern
2021-02-17  0:07       ` Wesley Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7d4174f-e441-58a6-25ee-fb89dd78844f@gmail.com \
    --to=sergei.shtylyov@gmail.com \
    --cc=balbi@kernel.org \
    --cc=dh10.jung@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox