]> git.baikalelectronics.ru Git - kernel.git/commit
PM / runtime: Asynchronous "idle" in pm_runtime_allow()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 29 Jun 2016 00:53:48 +0000 (02:53 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 1 Jul 2016 23:50:39 +0000 (01:50 +0200)
commit7216271e12c181fd64bab01a231adfbc7e7d2b21
treed1d83e4a6b7553725e7440ba685b8c2d058f6420
parentb733c0ec94922ae5b8c7647ed07eb4538972afd3
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>
drivers/base/power/runtime.c