diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-01 16:10:15 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-01 16:10:15 -0400 |
| commit | 7b5c39389c86063e86fe8f2e0093c7197ddfa60a (patch) | |
| tree | 550d98402980ee5a311b2990262404d2d49bed44 | |
| parent | 797cb8a6f7f1244ddd1e4bebebe38786d667057f (diff) | |
| parent | 9accff57e050d35f6c84554005b0e7caf0429b19 (diff) | |
Merge branch 'pm-runtime'
* pm-runtime:
PM / Runtime: Spelling s/competing/completing/
PM / Runtime: s/foo_process_requests/foo_process_next_request/
PM / Runtime: GENERIC_SUBSYS_PM_OPS is gone
PM / Runtime: Correct documented return values for generic PM callbacks
PM / Runtime: Split line longer than 80 characters
PM / Runtime: dev_pm_info.runtime_error is signed
| -rw-r--r-- | Documentation/power/runtime_pm.txt | 29 | ||||
| -rw-r--r-- | drivers/base/power/generic_ops.c | 2 |
2 files changed, 14 insertions, 17 deletions
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index b6ce00b2be9a..5f96daf8566a 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
| @@ -232,7 +232,7 @@ defined in include/linux/pm.h: | |||
| 232 | equal to zero); the initial value of it is 1 (i.e. runtime PM is | 232 | equal to zero); the initial value of it is 1 (i.e. runtime PM is |
| 233 | initially disabled for all devices) | 233 | initially disabled for all devices) |
| 234 | 234 | ||
| 235 | unsigned int runtime_error; | 235 | int runtime_error; |
| 236 | - if set, there was a fatal error (one of the callbacks returned error code | 236 | - if set, there was a fatal error (one of the callbacks returned error code |
| 237 | as described in Section 2), so the helper funtions will not work until | 237 | as described in Section 2), so the helper funtions will not work until |
| 238 | this flag is cleared; this is the error code returned by the failing | 238 | this flag is cleared; this is the error code returned by the failing |
| @@ -401,11 +401,11 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
| 401 | int pm_runtime_disable(struct device *dev); | 401 | int pm_runtime_disable(struct device *dev); |
| 402 | - increment the device's 'power.disable_depth' field (if the value of that | 402 | - increment the device's 'power.disable_depth' field (if the value of that |
| 403 | field was previously zero, this prevents subsystem-level runtime PM | 403 | field was previously zero, this prevents subsystem-level runtime PM |
| 404 | callbacks from being run for the device), make sure that all of the pending | 404 | callbacks from being run for the device), make sure that all of the |
| 405 | runtime PM operations on the device are either completed or canceled; | 405 | pending runtime PM operations on the device are either completed or |
| 406 | returns 1 if there was a resume request pending and it was necessary to | 406 | canceled; returns 1 if there was a resume request pending and it was |
| 407 | execute the subsystem-level resume callback for the device to satisfy that | 407 | necessary to execute the subsystem-level resume callback for the device |
| 408 | request, otherwise 0 is returned | 408 | to satisfy that request, otherwise 0 is returned |
| 409 | 409 | ||
| 410 | int pm_runtime_barrier(struct device *dev); | 410 | int pm_runtime_barrier(struct device *dev); |
| 411 | - check if there's a resume request pending for the device and resume it | 411 | - check if there's a resume request pending for the device and resume it |
| @@ -667,11 +667,11 @@ driver/base/power/generic_ops.c: | |||
| 667 | 667 | ||
| 668 | int pm_generic_runtime_suspend(struct device *dev); | 668 | int pm_generic_runtime_suspend(struct device *dev); |
| 669 | - invoke the ->runtime_suspend() callback provided by the driver of this | 669 | - invoke the ->runtime_suspend() callback provided by the driver of this |
| 670 | device and return its result, or return -EINVAL if not defined | 670 | device and return its result, or return 0 if not defined |
| 671 | 671 | ||
| 672 | int pm_generic_runtime_resume(struct device *dev); | 672 | int pm_generic_runtime_resume(struct device *dev); |
| 673 | - invoke the ->runtime_resume() callback provided by the driver of this | 673 | - invoke the ->runtime_resume() callback provided by the driver of this |
| 674 | device and return its result, or return -EINVAL if not defined | 674 | device and return its result, or return 0 if not defined |
| 675 | 675 | ||
| 676 | int pm_generic_suspend(struct device *dev); | 676 | int pm_generic_suspend(struct device *dev); |
| 677 | - if the device has not been suspended at run time, invoke the ->suspend() | 677 | - if the device has not been suspended at run time, invoke the ->suspend() |
| @@ -727,15 +727,12 @@ driver/base/power/generic_ops.c: | |||
| 727 | int pm_generic_restore_noirq(struct device *dev); | 727 | int pm_generic_restore_noirq(struct device *dev); |
| 728 | - invoke the ->restore_noirq() callback provided by the device's driver | 728 | - invoke the ->restore_noirq() callback provided by the device's driver |
| 729 | 729 | ||
| 730 | These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(), | 730 | These functions are the defaults used by the PM core, if a subsystem doesn't |
| 731 | provide its own callbacks for ->runtime_idle(), ->runtime_suspend(), | ||
| 731 | ->runtime_resume(), ->suspend(), ->suspend_noirq(), ->resume(), | 732 | ->runtime_resume(), ->suspend(), ->suspend_noirq(), ->resume(), |
| 732 | ->resume_noirq(), ->freeze(), ->freeze_noirq(), ->thaw(), ->thaw_noirq(), | 733 | ->resume_noirq(), ->freeze(), ->freeze_noirq(), ->thaw(), ->thaw_noirq(), |
| 733 | ->poweroff(), ->poweroff_noirq(), ->restore(), ->restore_noirq() callback | 734 | ->poweroff(), ->poweroff_noirq(), ->restore(), ->restore_noirq() in the |
| 734 | pointers in the subsystem-level dev_pm_ops structures. | 735 | subsystem-level dev_pm_ops structure. |
| 735 | |||
| 736 | If a subsystem wishes to use all of them at the same time, it can simply assign | ||
| 737 | the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its | ||
| 738 | dev_pm_ops structure pointer. | ||
| 739 | 736 | ||
| 740 | Device drivers that wish to use the same function as a system suspend, freeze, | 737 | Device drivers that wish to use the same function as a system suspend, freeze, |
| 741 | poweroff and runtime suspend callback, and similarly for system resume, thaw, | 738 | poweroff and runtime suspend callback, and similarly for system resume, thaw, |
| @@ -873,7 +870,7 @@ Here is a schematic pseudo-code example: | |||
| 873 | foo->is_suspended = 0; | 870 | foo->is_suspended = 0; |
| 874 | pm_runtime_mark_last_busy(&foo->dev); | 871 | pm_runtime_mark_last_busy(&foo->dev); |
| 875 | if (foo->num_pending_requests > 0) | 872 | if (foo->num_pending_requests > 0) |
| 876 | foo_process_requests(foo); | 873 | foo_process_next_request(foo); |
| 877 | unlock(&foo->private_lock); | 874 | unlock(&foo->private_lock); |
| 878 | return 0; | 875 | return 0; |
| 879 | } | 876 | } |
diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c index a2e55bfdf572..96a92db83cad 100644 --- a/drivers/base/power/generic_ops.c +++ b/drivers/base/power/generic_ops.c | |||
| @@ -285,7 +285,7 @@ int pm_generic_restore(struct device *dev) | |||
| 285 | EXPORT_SYMBOL_GPL(pm_generic_restore); | 285 | EXPORT_SYMBOL_GPL(pm_generic_restore); |
| 286 | 286 | ||
| 287 | /** | 287 | /** |
| 288 | * pm_generic_complete - Generic routine competing a device power transition. | 288 | * pm_generic_complete - Generic routine completing a device power transition. |
| 289 | * @dev: Device to handle. | 289 | * @dev: Device to handle. |
| 290 | * | 290 | * |
| 291 | * Complete a device power transition during a system-wide power transition. | 291 | * Complete a device power transition during a system-wide power transition. |
