diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-10 11:14:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-10 11:14:53 -0500 |
commit | c8940eca75e6d1ea57f6c491a30bd1023c64c9ad (patch) | |
tree | d68944ab9fa8ba3c77b18edc2bd836c7e355b23e /Documentation | |
parent | 78c92a9fd4b6abbbc1fe1ec335c697cb4e63f252 (diff) | |
parent | 3ae22e8c8ac39daf88ae32f047fb23825be7c646 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
spi / PM: Support dev_pm_ops
PM: Prototype the pm_generic_ operations
PM / Runtime: Generic resume shouldn't set RPM_ACTIVE unconditionally
PM: Use dev_name() in core device suspend and resume routines
PM: Permit registration of parentless devices during system suspend
PM: Replace the device power.status field with a bit field
PM: Remove redundant checks from core device resume routines
PM: Use a different list of devices for each stage of device suspend
PM: Avoid compiler warning in pm_noirq_op()
PM: Use pm_wakeup_pending() in __device_suspend()
PM / Wakeup: Replace pm_check_wakeup_events() with pm_wakeup_pending()
PM: Prevent dpm_prepare() from returning errors unnecessarily
PM: Fix references to basic-pm-debugging.txt in drivers-testing.txt
PM / Runtime: Add synchronous runtime interface for interrupt handlers (v3)
PM / Hibernate: When failed, in_suspend should be reset
PM / Hibernate: hibernation_ops->leave should be checked too
Freezer: Fix a race during freezing of TASK_STOPPED tasks
PM: Use proper ccflag flag in kernel/power/Makefile
PM / Runtime: Fix comments to match runtime callback code
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/power/drivers-testing.txt | 8 | ||||
-rw-r--r-- | Documentation/power/runtime_pm.txt | 31 |
2 files changed, 35 insertions, 4 deletions
diff --git a/Documentation/power/drivers-testing.txt b/Documentation/power/drivers-testing.txt index 7f7a737f7f9f..638afdf4d6b8 100644 --- a/Documentation/power/drivers-testing.txt +++ b/Documentation/power/drivers-testing.txt | |||
@@ -23,10 +23,10 @@ Once you have resolved the suspend/resume-related problems with your test system | |||
23 | without the new driver, you are ready to test it: | 23 | without the new driver, you are ready to test it: |
24 | 24 | ||
25 | a) Build the driver as a module, load it and try the test modes of hibernation | 25 | a) Build the driver as a module, load it and try the test modes of hibernation |
26 | (see: Documents/power/basic-pm-debugging.txt, 1). | 26 | (see: Documentation/power/basic-pm-debugging.txt, 1). |
27 | 27 | ||
28 | b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and | 28 | b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and |
29 | "platform" modes (see: Documents/power/basic-pm-debugging.txt, 1). | 29 | "platform" modes (see: Documentation/power/basic-pm-debugging.txt, 1). |
30 | 30 | ||
31 | c) Compile the driver directly into the kernel and try the test modes of | 31 | c) Compile the driver directly into the kernel and try the test modes of |
32 | hibernation. | 32 | hibernation. |
@@ -34,12 +34,12 @@ c) Compile the driver directly into the kernel and try the test modes of | |||
34 | d) Attempt to hibernate with the driver compiled directly into the kernel | 34 | d) Attempt to hibernate with the driver compiled directly into the kernel |
35 | in the "reboot", "shutdown" and "platform" modes. | 35 | in the "reboot", "shutdown" and "platform" modes. |
36 | 36 | ||
37 | e) Try the test modes of suspend (see: Documents/power/basic-pm-debugging.txt, | 37 | e) Try the test modes of suspend (see: Documentation/power/basic-pm-debugging.txt, |
38 | 2). [As far as the STR tests are concerned, it should not matter whether or | 38 | 2). [As far as the STR tests are concerned, it should not matter whether or |
39 | not the driver is built as a module.] | 39 | not the driver is built as a module.] |
40 | 40 | ||
41 | f) Attempt to suspend to RAM using the s2ram tool with the driver loaded | 41 | f) Attempt to suspend to RAM using the s2ram tool with the driver loaded |
42 | (see: Documents/power/basic-pm-debugging.txt, 2). | 42 | (see: Documentation/power/basic-pm-debugging.txt, 2). |
43 | 43 | ||
44 | Each of the above tests should be repeated several times and the STD tests | 44 | Each of the above tests should be repeated several times and the STD tests |
45 | should be mixed with the STR tests. If any of them fails, the driver cannot be | 45 | should be mixed with the STR tests. If any of them fails, the driver cannot be |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 41cc7b30d7dd..ffe55ffa540a 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
@@ -50,6 +50,15 @@ type's callbacks are not defined) of given device. The bus type, device type | |||
50 | and device class callbacks are referred to as subsystem-level callbacks in what | 50 | and device class callbacks are referred to as subsystem-level callbacks in what |
51 | follows. | 51 | follows. |
52 | 52 | ||
53 | By default, the callbacks are always invoked in process context with interrupts | ||
54 | enabled. However, subsystems can use the pm_runtime_irq_safe() helper function | ||
55 | to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume() | ||
56 | callbacks should be invoked in atomic context with interrupts disabled | ||
57 | (->runtime_idle() is still invoked the default way). This implies that these | ||
58 | callback routines must not block or sleep, but it also means that the | ||
59 | synchronous helper functions listed at the end of Section 4 can be used within | ||
60 | an interrupt handler or in an atomic context. | ||
61 | |||
53 | The subsystem-level suspend callback is _entirely_ _responsible_ for handling | 62 | The subsystem-level suspend callback is _entirely_ _responsible_ for handling |
54 | the suspend of the device as appropriate, which may, but need not include | 63 | the suspend of the device as appropriate, which may, but need not include |
55 | executing the device driver's own ->runtime_suspend() callback (from the | 64 | executing the device driver's own ->runtime_suspend() callback (from the |
@@ -237,6 +246,10 @@ defined in include/linux/pm.h: | |||
237 | Section 8); it may be modified only by the pm_runtime_no_callbacks() | 246 | Section 8); it may be modified only by the pm_runtime_no_callbacks() |
238 | helper function | 247 | helper function |
239 | 248 | ||
249 | unsigned int irq_safe; | ||
250 | - indicates that the ->runtime_suspend() and ->runtime_resume() callbacks | ||
251 | will be invoked with the spinlock held and interrupts disabled | ||
252 | |||
240 | unsigned int use_autosuspend; | 253 | unsigned int use_autosuspend; |
241 | - indicates that the device's driver supports delayed autosuspend (see | 254 | - indicates that the device's driver supports delayed autosuspend (see |
242 | Section 9); it may be modified only by the | 255 | Section 9); it may be modified only by the |
@@ -344,6 +357,10 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
344 | - decrement the device's usage counter; if the result is 0 then run | 357 | - decrement the device's usage counter; if the result is 0 then run |
345 | pm_runtime_idle(dev) and return its result | 358 | pm_runtime_idle(dev) and return its result |
346 | 359 | ||
360 | int pm_runtime_put_sync_suspend(struct device *dev); | ||
361 | - decrement the device's usage counter; if the result is 0 then run | ||
362 | pm_runtime_suspend(dev) and return its result | ||
363 | |||
347 | int pm_runtime_put_sync_autosuspend(struct device *dev); | 364 | int pm_runtime_put_sync_autosuspend(struct device *dev); |
348 | - decrement the device's usage counter; if the result is 0 then run | 365 | - decrement the device's usage counter; if the result is 0 then run |
349 | pm_runtime_autosuspend(dev) and return its result | 366 | pm_runtime_autosuspend(dev) and return its result |
@@ -397,6 +414,11 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
397 | PM attributes from /sys/devices/.../power (or prevent them from being | 414 | PM attributes from /sys/devices/.../power (or prevent them from being |
398 | added when the device is registered) | 415 | added when the device is registered) |
399 | 416 | ||
417 | void pm_runtime_irq_safe(struct device *dev); | ||
418 | - set the power.irq_safe flag for the device, causing the runtime-PM | ||
419 | suspend and resume callbacks (but not the idle callback) to be invoked | ||
420 | with interrupts disabled | ||
421 | |||
400 | void pm_runtime_mark_last_busy(struct device *dev); | 422 | void pm_runtime_mark_last_busy(struct device *dev); |
401 | - set the power.last_busy field to the current time | 423 | - set the power.last_busy field to the current time |
402 | 424 | ||
@@ -438,6 +460,15 @@ pm_runtime_suspended() | |||
438 | pm_runtime_mark_last_busy() | 460 | pm_runtime_mark_last_busy() |
439 | pm_runtime_autosuspend_expiration() | 461 | pm_runtime_autosuspend_expiration() |
440 | 462 | ||
463 | If pm_runtime_irq_safe() has been called for a device then the following helper | ||
464 | functions may also be used in interrupt context: | ||
465 | |||
466 | pm_runtime_suspend() | ||
467 | pm_runtime_autosuspend() | ||
468 | pm_runtime_resume() | ||
469 | pm_runtime_get_sync() | ||
470 | pm_runtime_put_sync_suspend() | ||
471 | |||
441 | 5. Run-time PM Initialization, Device Probing and Removal | 472 | 5. Run-time PM Initialization, Device Probing and Removal |
442 | 473 | ||
443 | Initially, the run-time PM is disabled for all devices, which means that the | 474 | Initially, the run-time PM is disabled for all devices, which means that the |