[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YKNjrv5shQcjZ4W5@atomide.com>
Date: Tue, 18 May 2021 09:50:22 +0300
From: Tony Lindgren <tony@...mide.com>
To: linux-omap@...r.kernel.org
Cc: Dave Gerlach <d-gerlach@...com>, Faiz Abbas <faiz_abbas@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Grygorii Strashko <grygorii.strashko@...com>,
Keerthy <j-keerthy@...com>, Nishanth Menon <nm@...com>,
Suman Anna <s-anna@...com>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] bus: ti-sysc: Fix am335x resume hang for usb otg module
* Tony Lindgren <tony@...mide.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
Powered by blists - more mailing lists