aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-07-02 08:27:11 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-07-02 08:27:11 -0400
commitf5da24dbed213d103f00aa9ef26e010b50d2db24 (patch)
treee98c31872c95a0223b4436fa909c48749c1346c2 /Documentation
parent5efb54cc3fc104585cda81c44676f05115bd9ddd (diff)
PM / Runtime: Update documentation regarding driver removal
Commit e1866b33b1e89f077b7132daae3dfd9a594e9a1a (PM / Runtime: Rework runtime PM handling during driver removal) forgot to update the documentation in Documentation/power/runtime_pm.txt to match the new code in drivers/base/dd.c. Update that documentation to match the code it describes. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/power/runtime_pm.txt26
1 files changed, 21 insertions, 5 deletions
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 518d9be4c731..b24875b1ced5 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -501,13 +501,29 @@ helper functions described in Section 4. In that case, pm_runtime_resume()
501should be used. Of course, for this purpose the device's run-time PM has to be 501should be used. Of course, for this purpose the device's run-time PM has to be
502enabled earlier by calling pm_runtime_enable(). 502enabled earlier by calling pm_runtime_enable().
503 503
504If the device bus type's or driver's ->probe() or ->remove() callback runs 504If the device bus type's or driver's ->probe() callback runs
505pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts, 505pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts,
506they will fail returning -EAGAIN, because the device's usage counter is 506they will fail returning -EAGAIN, because the device's usage counter is
507incremented by the core before executing ->probe() and ->remove(). Still, it 507incremented by the driver core before executing ->probe(). Still, it may be
508may be desirable to suspend the device as soon as ->probe() or ->remove() has 508desirable to suspend the device as soon as ->probe() has finished, so the driver
509finished, so the PM core uses pm_runtime_put_sync() to invoke the 509core uses pm_runtime_put_sync() to invoke the subsystem-level idle callback for
510subsystem-level idle callback for the device at that time. 510the device at that time.
511
512Moreover, the driver core prevents runtime PM callbacks from racing with the bus
513notifier callback in __device_release_driver(), which is necessary, because the
514notifier is used by some subsystems to carry out operations affecting the
515runtime PM functionality. It does so by calling pm_runtime_get_sync() before
516driver_sysfs_remove() and the BUS_NOTIFY_UNBIND_DRIVER notifications. This
517resumes the device if it's in the suspended state and prevents it from
518being suspended again while those routines are being executed.
519
520To allow bus types and drivers to put devices into the suspended state by
521calling pm_runtime_suspend() from their ->remove() routines, the driver core
522executes pm_runtime_put_sync() after running the BUS_NOTIFY_UNBIND_DRIVER
523notifications in __device_release_driver(). This requires bus types and
524drivers to make their ->remove() callbacks avoid races with runtime PM directly,
525but also it allows of more flexibility in the handling of devices during the
526removal of their drivers.
511 527
512The user space can effectively disallow the driver of the device to power manage 528The user space can effectively disallow the driver of the device to power manage
513it at run time by changing the value of its /sys/devices/.../power/control 529it at run time by changing the value of its /sys/devices/.../power/control