linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-omap@vger.kernel.org
Cc: Dave Gerlach <d-gerlach@ti.com>, Faiz Abbas <faiz_abbas@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	Keerthy <j-keerthy@ti.com>, Nishanth Menon <nm@ti.com>,
	Suman Anna <s-anna@ti.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] bus: ti-sysc: Fix am335x resume hang for usb otg module
Date: Tue, 18 May 2021 09:50:22 +0300	[thread overview]
Message-ID: <YKNjrv5shQcjZ4W5@atomide.com> (raw)
In-Reply-To: <20210429074533.33355-1-tony@atomide.com>

* Tony Lindgren <tony@atomide.com> [210429 10:45]:
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -1308,7 +1314,23 @@ static int __maybe_unused sysc_noirq_resume(struct device *dev)
>  	    (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE))
>  		return 0;
>  
> -	return pm_runtime_force_resume(dev);
> +	/* Only enable module if it was on, or needs to be reinitialized */
> +	if (ddata->needs_resume ||
> +	    ddata->cfg.quirks & SYSC_QUIRK_REINIT_ON_RESUME) {
> +		error = sysc_runtime_resume(dev);
> +		if (error)
> +			dev_warn(dev, "noirq_resume failed: %i\n", error);
> +	}
> +
> +	/* Idle quirky module again if it was not on before suspend */
> +	if (ddata->cfg.quirks & SYSC_QUIRK_REINIT_ON_RESUME &&
> +	    !ddata->needs_resume) {
> +		error = sysc_runtime_suspend(dev);
> +	}
> +
> +	ddata->needs_resume = 0;
> +
> +	return error;
>  }

Best to set this up as a separate function, otherwise cpu_pm won't
be able to use it eventually. I'll send out v2.

Regards,

Tony

      reply	other threads:[~2021-05-18  6:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29  7:45 [PATCH] bus: ti-sysc: Fix am335x resume hang for usb otg module Tony Lindgren
2021-05-18  6:50 ` Tony Lindgren [this message]

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=YKNjrv5shQcjZ4W5@atomide.com \
    --to=tony@atomide.com \
    --cc=d-gerlach@ti.com \
    --cc=faiz_abbas@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=grygorii.strashko@ti.com \
    --cc=j-keerthy@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=s-anna@ti.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;
as well as URLs for NNTP newsgroup(s).