Skip to content

Commit fe7450b

Browse files
committed
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>
1 parent 71723f9 commit fe7450b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/base/power/runtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ void pm_runtime_allow(struct device *dev)
12601260

12611261
dev->power.runtime_auto = true;
12621262
if (atomic_dec_and_test(&dev->power.usage_count))
1263-
rpm_idle(dev, RPM_AUTO);
1263+
rpm_idle(dev, RPM_AUTO | RPM_ASYNC);
12641264

12651265
out:
12661266
spin_unlock_irq(&dev->power.lock);

0 commit comments

Comments
 (0)