public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Kemnade <andreas@kemnade.info>
To: Tony Lindgren <tony@atomide.com>
Cc: Bin Liu <b-liu@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	letux-kernel@openphoenux.org
Subject: Re: [PATCH] usb: musb: Check devctl status again for a spurious session request
Date: Fri, 4 Jun 2021 16:45:01 +0200	[thread overview]
Message-ID: <20210604164501.5d2f3ce8@aktux> (raw)
In-Reply-To: <YLn06uuntThMlaTQ@atomide.com>

Hi Tony,

On Fri, 4 Jun 2021 12:39:54 +0300
Tony Lindgren <tony@atomide.com> wrote:

[...]
> Does the following patch fix things for you or does something else break again? :)
> 
It fixes things mostly. If I quickly enter suspend after usb
disconnect, current is still high in suspend (limit approx 2-3 seconds).
But I think this is the right track and these two patches are clearly an
improvement if applied together.

Regards,
Andreas


> Regards,
> 
> Tony
> 
> 8< --------------
> diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -332,6 +332,7 @@ static int omap2430_probe(struct platform_device *pdev)
>  	glue->musb			= musb;
>  	glue->status			= MUSB_UNKNOWN;
>  	glue->control_otghs = ERR_PTR(-ENODEV);
> +	glue->is_runtime_suspended	= 1;
>  
>  	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
>  	if (!pdata)
> @@ -453,6 +454,9 @@ static int omap2430_runtime_suspend(struct device *dev)
>  	if (!musb)
>  		return 0;
>  
> +	if (glue->is_runtime_suspended)
> +		return 0;
> +
>  	musb->context.otg_interfsel = musb_readl(musb->mregs,
>  						 OTG_INTERFSEL);
>  
> @@ -474,6 +478,9 @@ static int omap2430_runtime_resume(struct device *dev)
>  	if (!musb)
>  		return 0;
>  
> +	if (!glue->is_runtime_suspended)
> +		return 0;
> +
>  	phy_init(musb->phy);
>  	phy_power_on(musb->phy);
>  


  parent reply	other threads:[~2021-06-04 14:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 15:06 [PATCH] usb: musb: Check devctl status again for a spurious session request Tony Lindgren
2021-05-27 19:15 ` Andreas Kemnade
2021-05-28  5:57   ` Tony Lindgren
2021-05-28  9:37     ` Andreas Kemnade
2021-06-02  5:41       ` Tony Lindgren
2021-06-03 21:22         ` Andreas Kemnade
2021-06-04  8:35     ` Andreas Kemnade
2021-06-04  9:39       ` Tony Lindgren
2021-06-04  9:59         ` Andreas Kemnade
2021-06-04 10:08           ` Tony Lindgren
2021-06-04 10:20             ` Andreas Kemnade
2021-06-04 14:45         ` Andreas Kemnade [this message]
2021-06-04 16:59         ` Andreas Kemnade
2021-06-05  5:18           ` Tony Lindgren
2021-06-05 14:20             ` Andreas Kemnade
2021-06-06  6:01               ` Tony Lindgren

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=20210604164501.5d2f3ce8@aktux \
    --to=andreas@kemnade.info \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tony@atomide.com \
    /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