diff options
author | Rafael J. Wysocki | 2016-06-29 02:53:48 +0200 |
---|---|---|
committer | Rafael J. Wysocki | 2016-07-02 01:50:39 +0200 |
commit | fe7450b05fddebd5a76a5ad280a5ae9a82ce336f (patch) | |
tree | d1d83e4a6b7553725e7440ba685b8c2d058f6420 /drivers/base | |
parent | 71723f95463d284004bd0afe1825e6790a0c90d0 (diff) |
PM / runtime: Asynchronous "idle" in pm_runtime_allow()
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.
Reported-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/runtime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index e7ee8293055b..aa3ea5e25377 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -1260,7 +1260,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); |