From: Lukas Wunner <lukas@wunner.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux PM list <linux-pm@vger.kernel.org>,
Arjan van de Ven <arjan@linux.intel.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Kevin Hilman <khilman@baylibre.com>
Subject: Re: [PATCH] PM / runtime: Asynchronous "idle" in pm_runtime_allow()
Date: Wed, 29 Jun 2016 17:00:44 +0200 [thread overview]
Message-ID: <20160629150044.GA1900@wunner.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1606291002030.1917-100000@iolanthe.rowland.org>
On Wed, Jun 29, 2016 at 10:02:42AM -0400, Alan Stern wrote:
> On Wed, 29 Jun 2016, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > Arjan reports that it takes a relatively long time to enable runtime
> > PM for multiple devices at system startup, because all writes to the
> > "control" attribute in sysfs are handled synchronously and if the
> > device is suspended as a result of the write, it will block until
> > that operation is complete.
> >
> > That may be avoided by passing the RPM_ASYNC flag to rpm_idle()
> > in pm_runtime_allow() which will make it execute the device's
> > "idle" callback asynchronously, so writes to "control" changing
> > it from "on" to "auto" will return without waiting.
Looks like pm_runtime_allow() can now be added to the section "It is
safe to execute the following helper functions from interrupt context"
in Documentation/power/runtime_pm.txt.
Best regards,
Lukas
> >
> > Reported-by: Arjan van de Ven <arjan@linux.intel.com>
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> > drivers/base/power/runtime.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Index: linux-pm/drivers/base/power/runtime.c
> > ===================================================================
> > --- linux-pm.orig/drivers/base/power/runtime.c
> > +++ linux-pm/drivers/base/power/runtime.c
> > @@ -1256,7 +1256,7 @@ void pm_runtime_allow(struct device *dev
> >
> > dev->power.runtime_auto = true;
> > if (atomic_dec_and_test(&dev->power.usage_count))
> > - rpm_idle(dev, RPM_AUTO);
> > + rpm_idle(dev, RPM_AUTO | RPM_ASYNC);
> >
> > out:
> > spin_unlock_irq(&dev->power.lock);
>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
next prev parent reply other threads:[~2016-06-29 14:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-29 0:53 [PATCH] PM / runtime: Asynchronous "idle" in pm_runtime_allow() Rafael J. Wysocki
2016-06-29 14:02 ` Alan Stern
2016-06-29 15:00 ` Lukas Wunner [this message]
2016-06-29 16:48 ` Ulf Hansson
2016-06-30 22:48 ` Kevin Hilman
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=20160629150044.GA1900@wunner.de \
--to=lukas@wunner.de \
--cc=arjan@linux.intel.com \
--cc=khilman@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=stern@rowland.harvard.edu \
--cc=ulf.hansson@linaro.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;
as well as URLs for NNTP newsgroup(s).