aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/devices.txt118
-rw-r--r--Documentation/power/freezing-of-tasks.txt39
-rw-r--r--Documentation/power/runtime_pm.txt158
3 files changed, 193 insertions, 122 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
index 646a89e0c07d..20af7def23c8 100644
--- a/Documentation/power/devices.txt
+++ b/Documentation/power/devices.txt
@@ -123,9 +123,12 @@ please refer directly to the source code for more information about it.
123Subsystem-Level Methods 123Subsystem-Level Methods
124----------------------- 124-----------------------
125The core methods to suspend and resume devices reside in struct dev_pm_ops 125The core methods to suspend and resume devices reside in struct dev_pm_ops
126pointed to by the pm member of struct bus_type, struct device_type and 126pointed to by the ops member of struct dev_pm_domain, or by the pm member of
127struct class. They are mostly of interest to the people writing infrastructure 127struct bus_type, struct device_type and struct class. They are mostly of
128for buses, like PCI or USB, or device type and device class drivers. 128interest to the people writing infrastructure for platforms and buses, like PCI
129or USB, or device type and device class drivers. They also are relevant to the
130writers of device drivers whose subsystems (PM domains, device types, device
131classes and bus types) don't provide all power management methods.
129 132
130Bus drivers implement these methods as appropriate for the hardware and the 133Bus drivers implement these methods as appropriate for the hardware and the
131drivers using it; PCI works differently from USB, and so on. Not many people 134drivers using it; PCI works differently from USB, and so on. Not many people
@@ -139,41 +142,57 @@ sequencing in the driver model tree.
139 142
140/sys/devices/.../power/wakeup files 143/sys/devices/.../power/wakeup files
141----------------------------------- 144-----------------------------------
142All devices in the driver model have two flags to control handling of wakeup 145All device objects in the driver model contain fields that control the handling
143events (hardware signals that can force the device and/or system out of a low 146of system wakeup events (hardware signals that can force the system out of a
144power state). These flags are initialized by bus or device driver code using 147sleep state). These fields are initialized by bus or device driver code using
145device_set_wakeup_capable() and device_set_wakeup_enable(), defined in 148device_set_wakeup_capable() and device_set_wakeup_enable(), defined in
146include/linux/pm_wakeup.h. 149include/linux/pm_wakeup.h.
147 150
148The "can_wakeup" flag just records whether the device (and its driver) can 151The "power.can_wakeup" flag just records whether the device (and its driver) can
149physically support wakeup events. The device_set_wakeup_capable() routine 152physically support wakeup events. The device_set_wakeup_capable() routine
150affects this flag. The "should_wakeup" flag controls whether the device should 153affects this flag. The "power.wakeup" field is a pointer to an object of type
151try to use its wakeup mechanism. device_set_wakeup_enable() affects this flag; 154struct wakeup_source used for controlling whether or not the device should use
152for the most part drivers should not change its value. The initial value of 155its system wakeup mechanism and for notifying the PM core of system wakeup
153should_wakeup is supposed to be false for the majority of devices; the major 156events signaled by the device. This object is only present for wakeup-capable
154exceptions are power buttons, keyboards, and Ethernet adapters whose WoL 157devices (i.e. devices whose "can_wakeup" flags are set) and is created (or
155(wake-on-LAN) feature has been set up with ethtool. It should also default 158removed) by device_set_wakeup_capable().
156to true for devices that don't generate wakeup requests on their own but merely
157forward wakeup requests from one bus to another (like PCI bridges).
158 159
159Whether or not a device is capable of issuing wakeup events is a hardware 160Whether or not a device is capable of issuing wakeup events is a hardware
160matter, and the kernel is responsible for keeping track of it. By contrast, 161matter, and the kernel is responsible for keeping track of it. By contrast,
161whether or not a wakeup-capable device should issue wakeup events is a policy 162whether or not a wakeup-capable device should issue wakeup events is a policy
162decision, and it is managed by user space through a sysfs attribute: the 163decision, and it is managed by user space through a sysfs attribute: the
163power/wakeup file. User space can write the strings "enabled" or "disabled" to 164"power/wakeup" file. User space can write the strings "enabled" or "disabled"
164set or clear the "should_wakeup" flag, respectively. This file is only present 165to it to indicate whether or not, respectively, the device is supposed to signal
165for wakeup-capable devices (i.e. devices whose "can_wakeup" flags are set) 166system wakeup. This file is only present if the "power.wakeup" object exists
166and is created (or removed) by device_set_wakeup_capable(). Reads from the 167for the given device and is created (or removed) along with that object, by
167file will return the corresponding string. 168device_set_wakeup_capable(). Reads from the file will return the corresponding
168 169string.
169The device_may_wakeup() routine returns true only if both flags are set. 170
171The "power/wakeup" file is supposed to contain the "disabled" string initially
172for the majority of devices; the major exceptions are power buttons, keyboards,
173and Ethernet adapters whose WoL (wake-on-LAN) feature has been set up with
174ethtool. It should also default to "enabled" for devices that don't generate
175wakeup requests on their own but merely forward wakeup requests from one bus to
176another (like PCI Express ports).
177
178The device_may_wakeup() routine returns true only if the "power.wakeup" object
179exists and the corresponding "power/wakeup" file contains the string "enabled".
170This information is used by subsystems, like the PCI bus type code, to see 180This information is used by subsystems, like the PCI bus type code, to see
171whether or not to enable the devices' wakeup mechanisms. If device wakeup 181whether or not to enable the devices' wakeup mechanisms. If device wakeup
172mechanisms are enabled or disabled directly by drivers, they also should use 182mechanisms are enabled or disabled directly by drivers, they also should use
173device_may_wakeup() to decide what to do during a system sleep transition. 183device_may_wakeup() to decide what to do during a system sleep transition.
174However for runtime power management, wakeup events should be enabled whenever 184Device drivers, however, are not supposed to call device_set_wakeup_enable()
175the device and driver both support them, regardless of the should_wakeup flag. 185directly in any case.
176 186
187It ought to be noted that system wakeup is conceptually different from "remote
188wakeup" used by runtime power management, although it may be supported by the
189same physical mechanism. Remote wakeup is a feature allowing devices in
190low-power states to trigger specific interrupts to signal conditions in which
191they should be put into the full-power state. Those interrupts may or may not
192be used to signal system wakeup events, depending on the hardware design. On
193some systems it is impossible to trigger them from system sleep states. In any
194case, remote wakeup should always be enabled for runtime power management for
195all devices and drivers that support it.
177 196
178/sys/devices/.../power/control files 197/sys/devices/.../power/control files
179------------------------------------ 198------------------------------------
@@ -249,23 +268,37 @@ for every device before the next phase begins. Not all busses or classes
249support all these callbacks and not all drivers use all the callbacks. The 268support all these callbacks and not all drivers use all the callbacks. The
250various phases always run after tasks have been frozen and before they are 269various phases always run after tasks have been frozen and before they are
251unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have 270unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have
252been disabled (except for those marked with the IRQ_WAKEUP flag). 271been disabled (except for those marked with the IRQF_NO_SUSPEND flag).
272
273All phases use PM domain, bus, type, class or driver callbacks (that is, methods
274defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, dev->class->pm or
275dev->driver->pm). These callbacks are regarded by the PM core as mutually
276exclusive. Moreover, PM domain callbacks always take precedence over all of the
277other callbacks and, for example, type callbacks take precedence over bus, class
278and driver callbacks. To be precise, the following rules are used to determine
279which callback to execute in the given phase:
280
281 1. If dev->pm_domain is present, the PM core will choose the callback
282 included in dev->pm_domain->ops for execution
283
284 2. Otherwise, if both dev->type and dev->type->pm are present, the callback
285 included in dev->type->pm will be chosen for execution.
286
287 3. Otherwise, if both dev->class and dev->class->pm are present, the
288 callback included in dev->class->pm will be chosen for execution.
289
290 4. Otherwise, if both dev->bus and dev->bus->pm are present, the callback
291 included in dev->bus->pm will be chosen for execution.
292
293This allows PM domains and device types to override callbacks provided by bus
294types or device classes if necessary.
253 295
254All phases use bus, type, or class callbacks (that is, methods defined in 296The PM domain, type, class and bus callbacks may in turn invoke device- or
255dev->bus->pm, dev->type->pm, or dev->class->pm). These callbacks are mutually 297driver-specific methods stored in dev->driver->pm, but they don't have to do
256exclusive, so if the device type provides a struct dev_pm_ops object pointed to 298that.
257by its pm field (i.e. both dev->type and dev->type->pm are defined), the
258callbacks included in that object (i.e. dev->type->pm) will be used. Otherwise,
259if the class provides a struct dev_pm_ops object pointed to by its pm field
260(i.e. both dev->class and dev->class->pm are defined), the PM core will use the
261callbacks from that object (i.e. dev->class->pm). Finally, if the pm fields of
262both the device type and class objects are NULL (or those objects do not exist),
263the callbacks provided by the bus (that is, the callbacks from dev->bus->pm)
264will be used (this allows device types to override callbacks provided by bus
265types or classes if necessary).
266 299
267These callbacks may in turn invoke device- or driver-specific methods stored in 300If the subsystem callback chosen for execution is not present, the PM core will
268dev->driver->pm, but they don't have to. 301execute the corresponding method from dev->driver->pm instead if there is one.
269 302
270 303
271Entering System Suspend 304Entering System Suspend
@@ -283,9 +316,8 @@ When the system goes into the standby or memory sleep state, the phases are:
283 316
284 After the prepare callback method returns, no new children may be 317 After the prepare callback method returns, no new children may be
285 registered below the device. The method may also prepare the device or 318 registered below the device. The method may also prepare the device or
286 driver in some way for the upcoming system power transition (for 319 driver in some way for the upcoming system power transition, but it
287 example, by allocating additional memory required for this purpose), but 320 should not put the device into a low-power state.
288 it should not put the device into a low-power state.
289 321
290 2. The suspend methods should quiesce the device to stop it from performing 322 2. The suspend methods should quiesce the device to stop it from performing
291 I/O. They also may save the device registers and put it into the 323 I/O. They also may save the device registers and put it into the
diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
index 316c2ba187f4..6ccb68f68da6 100644
--- a/Documentation/power/freezing-of-tasks.txt
+++ b/Documentation/power/freezing-of-tasks.txt
@@ -21,7 +21,7 @@ freeze_processes() (defined in kernel/power/process.c) is called. It executes
21try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and 21try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and
22either wakes them up, if they are kernel threads, or sends fake signals to them, 22either wakes them up, if they are kernel threads, or sends fake signals to them,
23if they are user space processes. A task that has TIF_FREEZE set, should react 23if they are user space processes. A task that has TIF_FREEZE set, should react
24to it by calling the function called refrigerator() (defined in 24to it by calling the function called __refrigerator() (defined in
25kernel/freezer.c), which sets the task's PF_FROZEN flag, changes its state 25kernel/freezer.c), which sets the task's PF_FROZEN flag, changes its state
26to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it. 26to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it.
27Then, we say that the task is 'frozen' and therefore the set of functions 27Then, we say that the task is 'frozen' and therefore the set of functions
@@ -29,10 +29,10 @@ handling this mechanism is referred to as 'the freezer' (these functions are
29defined in kernel/power/process.c, kernel/freezer.c & include/linux/freezer.h). 29defined in kernel/power/process.c, kernel/freezer.c & include/linux/freezer.h).
30User space processes are generally frozen before kernel threads. 30User space processes are generally frozen before kernel threads.
31 31
32It is not recommended to call refrigerator() directly. Instead, it is 32__refrigerator() must not be called directly. Instead, use the
33recommended to use the try_to_freeze() function (defined in 33try_to_freeze() function (defined in include/linux/freezer.h), that checks
34include/linux/freezer.h), that checks the task's TIF_FREEZE flag and makes the 34the task's TIF_FREEZE flag and makes the task enter __refrigerator() if the
35task enter refrigerator() if the flag is set. 35flag is set.
36 36
37For user space processes try_to_freeze() is called automatically from the 37For user space processes try_to_freeze() is called automatically from the
38signal-handling code, but the freezable kernel threads need to call it 38signal-handling code, but the freezable kernel threads need to call it
@@ -61,13 +61,13 @@ wait_event_freezable() and wait_event_freezable_timeout() macros.
61After the system memory state has been restored from a hibernation image and 61After the system memory state has been restored from a hibernation image and
62devices have been reinitialized, the function thaw_processes() is called in 62devices have been reinitialized, the function thaw_processes() is called in
63order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that 63order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that
64have been frozen leave refrigerator() and continue running. 64have been frozen leave __refrigerator() and continue running.
65 65
66III. Which kernel threads are freezable? 66III. Which kernel threads are freezable?
67 67
68Kernel threads are not freezable by default. However, a kernel thread may clear 68Kernel threads are not freezable by default. However, a kernel thread may clear
69PF_NOFREEZE for itself by calling set_freezable() (the resetting of PF_NOFREEZE 69PF_NOFREEZE for itself by calling set_freezable() (the resetting of PF_NOFREEZE
70directly is strongly discouraged). From this point it is regarded as freezable 70directly is not allowed). From this point it is regarded as freezable
71and must call try_to_freeze() in a suitable place. 71and must call try_to_freeze() in a suitable place.
72 72
73IV. Why do we do that? 73IV. Why do we do that?
@@ -176,3 +176,28 @@ tasks, since it generally exists anyway.
176A driver must have all firmwares it may need in RAM before suspend() is called. 176A driver must have all firmwares it may need in RAM before suspend() is called.
177If keeping them is not practical, for example due to their size, they must be 177If keeping them is not practical, for example due to their size, they must be
178requested early enough using the suspend notifier API described in notifiers.txt. 178requested early enough using the suspend notifier API described in notifiers.txt.
179
180VI. Are there any precautions to be taken to prevent freezing failures?
181
182Yes, there are.
183
184First of all, grabbing the 'pm_mutex' lock to mutually exclude a piece of code
185from system-wide sleep such as suspend/hibernation is not encouraged.
186If possible, that piece of code must instead hook onto the suspend/hibernation
187notifiers to achieve mutual exclusion. Look at the CPU-Hotplug code
188(kernel/cpu.c) for an example.
189
190However, if that is not feasible, and grabbing 'pm_mutex' is deemed necessary,
191it is strongly discouraged to directly call mutex_[un]lock(&pm_mutex) since
192that could lead to freezing failures, because if the suspend/hibernate code
193successfully acquired the 'pm_mutex' lock, and hence that other entity failed
194to acquire the lock, then that task would get blocked in TASK_UNINTERRUPTIBLE
195state. As a consequence, the freezer would not be able to freeze that task,
196leading to freezing failure.
197
198However, the [un]lock_system_sleep() APIs are safe to use in this scenario,
199since they ask the freezer to skip freezing this task, since it is anyway
200"frozen enough" as it is blocked on 'pm_mutex', which will be released
201only after the entire suspend/hibernation sequence is complete.
202So, to summarize, use [un]lock_system_sleep() instead of directly using
203mutex_[un]lock(&pm_mutex). That would prevent freezing failures.
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 5336149f831b..4abe83e1045a 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -44,98 +44,112 @@ struct dev_pm_ops {
44}; 44};
45 45
46The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks 46The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks
47are executed by the PM core for either the power domain, or the device type 47are executed by the PM core for the device's subsystem that may be either of
48(if the device power domain's struct dev_pm_ops does not exist), or the class 48the following:
49(if the device power domain's and type's struct dev_pm_ops object does not 49
50exist), or the bus type (if the device power domain's, type's and class' 50 1. PM domain of the device, if the device's PM domain object, dev->pm_domain,
51struct dev_pm_ops objects do not exist) of the given device, so the priority 51 is present.
52order of callbacks from high to low is that power domain callbacks, device 52
53type callbacks, class callbacks and bus type callbacks, and the high priority 53 2. Device type of the device, if both dev->type and dev->type->pm are present.
54one will take precedence over low priority one. The bus type, device type and 54
55class callbacks are referred to as subsystem-level callbacks in what follows, 55 3. Device class of the device, if both dev->class and dev->class->pm are
56and generally speaking, the power domain callbacks are used for representing 56 present.
57power domains within a SoC. 57
58 4. Bus type of the device, if both dev->bus and dev->bus->pm are present.
59
60If the subsystem chosen by applying the above rules doesn't provide the relevant
61callback, the PM core will invoke the corresponding driver callback stored in
62dev->driver->pm directly (if present).
63
64The PM core always checks which callback to use in the order given above, so the
65priority order of callbacks from high to low is: PM domain, device type, class
66and bus type. Moreover, the high-priority one will always take precedence over
67a low-priority one. The PM domain, bus type, device type and class callbacks
68are referred to as subsystem-level callbacks in what follows.
58 69
59By default, the callbacks are always invoked in process context with interrupts 70By default, the callbacks are always invoked in process context with interrupts
60enabled. However, subsystems can use the pm_runtime_irq_safe() helper function 71enabled. However, the pm_runtime_irq_safe() helper function can be used to tell
61to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume() 72the PM core that it is safe to run the ->runtime_suspend(), ->runtime_resume()
62callbacks should be invoked in atomic context with interrupts disabled. 73and ->runtime_idle() callbacks for the given device in atomic context with
63This implies that these callback routines must not block or sleep, but it also 74interrupts disabled. This implies that the callback routines in question must
64means that the synchronous helper functions listed at the end of Section 4 can 75not block or sleep, but it also means that the synchronous helper functions
65be used within an interrupt handler or in an atomic context. 76listed at the end of Section 4 may be used for that device within an interrupt
66 77handler or generally in an atomic context.
67The subsystem-level suspend callback is _entirely_ _responsible_ for handling 78
68the suspend of the device as appropriate, which may, but need not include 79The subsystem-level suspend callback, if present, is _entirely_ _responsible_
69executing the device driver's own ->runtime_suspend() callback (from the 80for handling the suspend of the device as appropriate, which may, but need not
81include executing the device driver's own ->runtime_suspend() callback (from the
70PM core's point of view it is not necessary to implement a ->runtime_suspend() 82PM core's point of view it is not necessary to implement a ->runtime_suspend()
71callback in a device driver as long as the subsystem-level suspend callback 83callback in a device driver as long as the subsystem-level suspend callback
72knows what to do to handle the device). 84knows what to do to handle the device).
73 85
74 * Once the subsystem-level suspend callback has completed successfully 86 * Once the subsystem-level suspend callback (or the driver suspend callback,
75 for given device, the PM core regards the device as suspended, which need 87 if invoked directly) has completed successfully for the given device, the PM
76 not mean that the device has been put into a low power state. It is 88 core regards the device as suspended, which need not mean that it has been
77 supposed to mean, however, that the device will not process data and will 89 put into a low power state. It is supposed to mean, however, that the
78 not communicate with the CPU(s) and RAM until the subsystem-level resume 90 device will not process data and will not communicate with the CPU(s) and
79 callback is executed for it. The runtime PM status of a device after 91 RAM until the appropriate resume callback is executed for it. The runtime
80 successful execution of the subsystem-level suspend callback is 'suspended'. 92 PM status of a device after successful execution of the suspend callback is
81 93 'suspended'.
82 * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN, 94
83 the device's runtime PM status is 'active', which means that the device 95 * If the suspend callback returns -EBUSY or -EAGAIN, the device's runtime PM
84 _must_ be fully operational afterwards. 96 status remains 'active', which means that the device _must_ be fully
85 97 operational afterwards.
86 * If the subsystem-level suspend callback returns an error code different 98
87 from -EBUSY or -EAGAIN, the PM core regards this as a fatal error and will 99 * If the suspend callback returns an error code different from -EBUSY and
88 refuse to run the helper functions described in Section 4 for the device, 100 -EAGAIN, the PM core regards this as a fatal error and will refuse to run
89 until the status of it is directly set either to 'active', or to 'suspended' 101 the helper functions described in Section 4 for the device until its status
90 (the PM core provides special helper functions for this purpose). 102 is directly set to either'active', or 'suspended' (the PM core provides
91 103 special helper functions for this purpose).
92In particular, if the driver requires remote wake-up capability (i.e. hardware 104
105In particular, if the driver requires remote wakeup capability (i.e. hardware
93mechanism allowing the device to request a change of its power state, such as 106mechanism allowing the device to request a change of its power state, such as
94PCI PME) for proper functioning and device_run_wake() returns 'false' for the 107PCI PME) for proper functioning and device_run_wake() returns 'false' for the
95device, then ->runtime_suspend() should return -EBUSY. On the other hand, if 108device, then ->runtime_suspend() should return -EBUSY. On the other hand, if
96device_run_wake() returns 'true' for the device and the device is put into a low 109device_run_wake() returns 'true' for the device and the device is put into a
97power state during the execution of the subsystem-level suspend callback, it is 110low-power state during the execution of the suspend callback, it is expected
98expected that remote wake-up will be enabled for the device. Generally, remote 111that remote wakeup will be enabled for the device. Generally, remote wakeup
99wake-up should be enabled for all input devices put into a low power state at 112should be enabled for all input devices put into low-power states at run time.
100run time. 113
101 114The subsystem-level resume callback, if present, is _entirely_ _responsible_ for
102The subsystem-level resume callback is _entirely_ _responsible_ for handling the 115handling the resume of the device as appropriate, which may, but need not
103resume of the device as appropriate, which may, but need not include executing 116include executing the device driver's own ->runtime_resume() callback (from the
104the device driver's own ->runtime_resume() callback (from the PM core's point of 117PM core's point of view it is not necessary to implement a ->runtime_resume()
105view it is not necessary to implement a ->runtime_resume() callback in a device 118callback in a device driver as long as the subsystem-level resume callback knows
106driver as long as the subsystem-level resume callback knows what to do to handle 119what to do to handle the device).
107the device). 120
108 121 * Once the subsystem-level resume callback (or the driver resume callback, if
109 * Once the subsystem-level resume callback has completed successfully, the PM 122 invoked directly) has completed successfully, the PM core regards the device
110 core regards the device as fully operational, which means that the device 123 as fully operational, which means that the device _must_ be able to complete
111 _must_ be able to complete I/O operations as needed. The runtime PM status 124 I/O operations as needed. The runtime PM status of the device is then
112 of the device is then 'active'. 125 'active'.
113 126
114 * If the subsystem-level resume callback returns an error code, the PM core 127 * If the resume callback returns an error code, the PM core regards this as a
115 regards this as a fatal error and will refuse to run the helper functions 128 fatal error and will refuse to run the helper functions described in Section
116 described in Section 4 for the device, until its status is directly set 129 4 for the device, until its status is directly set to either 'active', or
117 either to 'active' or to 'suspended' (the PM core provides special helper 130 'suspended' (by means of special helper functions provided by the PM core
118 functions for this purpose). 131 for this purpose).
119 132
120The subsystem-level idle callback is executed by the PM core whenever the device 133The idle callback (a subsystem-level one, if present, or the driver one) is
121appears to be idle, which is indicated to the PM core by two counters, the 134executed by the PM core whenever the device appears to be idle, which is
122device's usage counter and the counter of 'active' children of the device. 135indicated to the PM core by two counters, the device's usage counter and the
136counter of 'active' children of the device.
123 137
124 * If any of these counters is decreased using a helper function provided by 138 * If any of these counters is decreased using a helper function provided by
125 the PM core and it turns out to be equal to zero, the other counter is 139 the PM core and it turns out to be equal to zero, the other counter is
126 checked. If that counter also is equal to zero, the PM core executes the 140 checked. If that counter also is equal to zero, the PM core executes the
127 subsystem-level idle callback with the device as an argument. 141 idle callback with the device as its argument.
128 142
129The action performed by a subsystem-level idle callback is totally dependent on 143The action performed by the idle callback is totally dependent on the subsystem
130the subsystem in question, but the expected and recommended action is to check 144(or driver) in question, but the expected and recommended action is to check
131if the device can be suspended (i.e. if all of the conditions necessary for 145if the device can be suspended (i.e. if all of the conditions necessary for
132suspending the device are satisfied) and to queue up a suspend request for the 146suspending the device are satisfied) and to queue up a suspend request for the
133device in that case. The value returned by this callback is ignored by the PM 147device in that case. The value returned by this callback is ignored by the PM
134core. 148core.
135 149
136The helper functions provided by the PM core, described in Section 4, guarantee 150The helper functions provided by the PM core, described in Section 4, guarantee
137that the following constraints are met with respect to the bus type's runtime 151that the following constraints are met with respect to runtime PM callbacks for
138PM callbacks: 152one device:
139 153
140(1) The callbacks are mutually exclusive (e.g. it is forbidden to execute 154(1) The callbacks are mutually exclusive (e.g. it is forbidden to execute
141 ->runtime_suspend() in parallel with ->runtime_resume() or with another 155 ->runtime_suspend() in parallel with ->runtime_resume() or with another