Skip to content

Commit 7e0bb71

Browse files
committed
Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
* 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (63 commits) PM / Clocks: Remove redundant NULL checks before kfree() PM / Documentation: Update docs about suspend and CPU hotplug ACPI / PM: Add Sony VGN-FW21E to nonvs blacklist. ARM: mach-shmobile: sh7372 A4R support (v4) ARM: mach-shmobile: sh7372 A3SP support (v4) PM / Sleep: Mark devices involved in wakeup signaling during suspend PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image PM / Hibernate: Do not initialize static and extern variables to 0 PM / Freezer: Make fake_signal_wake_up() wake TASK_KILLABLE tasks too PM / Hibernate: Add resumedelay kernel param in addition to resumewait MAINTAINERS: Update linux-pm list address PM / ACPI: Blacklist Vaio VGN-FW520F machine known to require acpi_sleep=nonvs PM / ACPI: Blacklist Sony Vaio known to require acpi_sleep=nonvs PM / Hibernate: Add resumewait param to support MMC-like devices as resume file PM / Hibernate: Fix typo in a kerneldoc comment PM / Hibernate: Freeze kernel threads after preallocating memory PM: Update the policy on default wakeup settings PM / VT: Cleanup #if defined uglyness and fix compile error PM / Suspend: Off by one in pm_suspend() PM / Hibernate: Include storage keys in hibernation image on s390 ...
2 parents b9e2780 + 0ab1e79 commit 7e0bb71

99 files changed

Lines changed: 4720 additions & 1044 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
What: /sys/class/devfreq/.../
2+
Date: September 2011
3+
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
4+
Description:
5+
Provide a place in sysfs for the devfreq objects.
6+
This allows accessing various devfreq specific variables.
7+
The name of devfreq object denoted as ... is same as the
8+
name of device using devfreq.
9+
10+
What: /sys/class/devfreq/.../governor
11+
Date: September 2011
12+
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
13+
Description:
14+
The /sys/class/devfreq/.../governor shows the name of the
15+
governor used by the corresponding devfreq object.
16+
17+
What: /sys/class/devfreq/.../cur_freq
18+
Date: September 2011
19+
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
20+
Description:
21+
The /sys/class/devfreq/.../cur_freq shows the current
22+
frequency of the corresponding devfreq object.
23+
24+
What: /sys/class/devfreq/.../central_polling
25+
Date: September 2011
26+
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
27+
Description:
28+
The /sys/class/devfreq/.../central_polling shows whether
29+
the devfreq ojbect is using devfreq-provided central
30+
polling mechanism or not.
31+
32+
What: /sys/class/devfreq/.../polling_interval
33+
Date: September 2011
34+
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
35+
Description:
36+
The /sys/class/devfreq/.../polling_interval shows and sets
37+
the requested polling interval of the corresponding devfreq
38+
object. The values are represented in ms. If the value is
39+
less than 1 jiffy, it is considered to be 0, which means
40+
no polling. This value is meaningless if the governor is
41+
not polling; thus. If the governor is not using
42+
devfreq-provided central polling
43+
(/sys/class/devfreq/.../central_polling is 0), this value
44+
may be useless.
45+
46+
What: /sys/class/devfreq/.../userspace/set_freq
47+
Date: September 2011
48+
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
49+
Description:
50+
The /sys/class/devfreq/.../userspace/set_freq shows and
51+
sets the requested frequency for the devfreq object if
52+
userspace governor is in effect.

‎Documentation/kernel-parameters.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,6 +2246,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
22462246
in <PAGE_SIZE> units (needed only for swap files).
22472247
See Documentation/power/swsusp-and-swap-files.txt
22482248

2249+
resumedelay= [HIBERNATION] Delay (in seconds) to pause before attempting to
2250+
read the resume files
2251+
2252+
resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up.
2253+
Useful for devices that are detected asynchronously
2254+
(e.g. USB and MMC devices).
2255+
22492256
hibernate= [HIBERNATION]
22502257
noresume Don't check if there's a hibernation image
22512258
present during boot.

‎Documentation/power/00-INDEX‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ s2ram.txt
2626
- How to get suspend to ram working (and debug it when it isn't)
2727
states.txt
2828
- System power management states
29+
suspend-and-cpuhotplug.txt
30+
- Explains the interaction between Suspend-to-RAM (S3) and CPU hotplug
2931
swsusp-and-swap-files.txt
3032
- Using swap files with software suspend (to disk)
3133
swsusp-dmcrypt.txt

‎Documentation/power/basic-pm-debugging.txt‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,27 @@ case, you may be able to search for failing drivers by following the procedure
201201
analogous to the one described in section 1. If you find some failing drivers,
202202
you will have to unload them every time before an STR transition (ie. before
203203
you run s2ram), and please report the problems with them.
204+
205+
There is a debugfs entry which shows the suspend to RAM statistics. Here is an
206+
example of its output.
207+
# mount -t debugfs none /sys/kernel/debug
208+
# cat /sys/kernel/debug/suspend_stats
209+
success: 20
210+
fail: 5
211+
failed_freeze: 0
212+
failed_prepare: 0
213+
failed_suspend: 5
214+
failed_suspend_noirq: 0
215+
failed_resume: 0
216+
failed_resume_noirq: 0
217+
failures:
218+
last_failed_dev: alarm
219+
adc
220+
last_failed_errno: -16
221+
-16
222+
last_failed_step: suspend
223+
suspend
224+
Field success means the success number of suspend to RAM, and field fail means
225+
the failure number. Others are the failure number of different steps of suspend
226+
to RAM. suspend_stats just lists the last 2 failed devices, error number and
227+
failed step of suspend.

‎Documentation/power/devices.txt‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ try to use its wakeup mechanism. device_set_wakeup_enable() affects this flag;
152152
for the most part drivers should not change its value. The initial value of
153153
should_wakeup is supposed to be false for the majority of devices; the major
154154
exceptions are power buttons, keyboards, and Ethernet adapters whose WoL
155-
(wake-on-LAN) feature has been set up with ethtool.
155+
(wake-on-LAN) feature has been set up with ethtool. It should also default
156+
to true for devices that don't generate wakeup requests on their own but merely
157+
forward wakeup requests from one bus to another (like PCI bridges).
156158

157159
Whether or not a device is capable of issuing wakeup events is a hardware
158160
matter, and the kernel is responsible for keeping track of it. By contrast,
@@ -279,10 +281,6 @@ When the system goes into the standby or memory sleep state, the phases are:
279281
time.) Unlike the other suspend-related phases, during the prepare
280282
phase the device tree is traversed top-down.
281283

282-
In addition to that, if device drivers need to allocate additional
283-
memory to be able to hadle device suspend correctly, that should be
284-
done in the prepare phase.
285-
286284
After the prepare callback method returns, no new children may be
287285
registered below the device. The method may also prepare the device or
288286
driver in some way for the upcoming system power transition (for

‎Documentation/power/pm_qos_interface.txt‎

Lines changed: 87 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ This interface provides a kernel and user mode interface for registering
44
performance expectations by drivers, subsystems and user space applications on
55
one of the parameters.
66

7-
Currently we have {cpu_dma_latency, network_latency, network_throughput} as the
8-
initial set of pm_qos parameters.
7+
Two different PM QoS frameworks are available:
8+
1. PM QoS classes for cpu_dma_latency, network_latency, network_throughput.
9+
2. the per-device PM QoS framework provides the API to manage the per-device latency
10+
constraints.
911

1012
Each parameters have defined units:
1113
* latency: usec
1214
* timeout: usec
1315
* throughput: kbs (kilo bit / sec)
1416

17+
18+
1. PM QoS framework
19+
1520
The infrastructure exposes multiple misc device nodes one per implemented
1621
parameter. The set of parameters implement is defined by pm_qos_power_init()
1722
and pm_qos_params.h. This is done because having the available parameters
@@ -23,14 +28,18 @@ an aggregated target value. The aggregated target value is updated with
2328
changes to the request list or elements of the list. Typically the
2429
aggregated target value is simply the max or min of the request values held
2530
in the parameter list elements.
31+
Note: the aggregated target value is implemented as an atomic variable so that
32+
reading the aggregated value does not require any locking mechanism.
33+
2634

2735
From kernel mode the use of this interface is simple:
2836

29-
handle = pm_qos_add_request(param_class, target_value):
30-
Will insert an element into the list for that identified PM_QOS class with the
37+
void pm_qos_add_request(handle, param_class, target_value):
38+
Will insert an element into the list for that identified PM QoS class with the
3139
target value. Upon change to this list the new target is recomputed and any
3240
registered notifiers are called only if the target value is now different.
33-
Clients of pm_qos need to save the returned handle.
41+
Clients of pm_qos need to save the returned handle for future use in other
42+
pm_qos API functions.
3443

3544
void pm_qos_update_request(handle, new_target_value):
3645
Will update the list element pointed to by the handle with the new target value
@@ -42,6 +51,20 @@ Will remove the element. After removal it will update the aggregate target and
4251
call the notification tree if the target was changed as a result of removing
4352
the request.
4453

54+
int pm_qos_request(param_class):
55+
Returns the aggregated value for a given PM QoS class.
56+
57+
int pm_qos_request_active(handle):
58+
Returns if the request is still active, i.e. it has not been removed from a
59+
PM QoS class constraints list.
60+
61+
int pm_qos_add_notifier(param_class, notifier):
62+
Adds a notification callback function to the PM QoS class. The callback is
63+
called when the aggregated value for the PM QoS class is changed.
64+
65+
int pm_qos_remove_notifier(int param_class, notifier):
66+
Removes the notification callback function for the PM QoS class.
67+
4568

4669
From user mode:
4770
Only processes can register a pm_qos request. To provide for automatic
@@ -63,4 +86,63 @@ To remove the user mode request for a target value simply close the device
6386
node.
6487

6588

89+
2. PM QoS per-device latency framework
90+
91+
For each device a list of performance requests is maintained along with
92+
an aggregated target value. The aggregated target value is updated with
93+
changes to the request list or elements of the list. Typically the
94+
aggregated target value is simply the max or min of the request values held
95+
in the parameter list elements.
96+
Note: the aggregated target value is implemented as an atomic variable so that
97+
reading the aggregated value does not require any locking mechanism.
98+
99+
100+
From kernel mode the use of this interface is the following:
101+
102+
int dev_pm_qos_add_request(device, handle, value):
103+
Will insert an element into the list for that identified device with the
104+
target value. Upon change to this list the new target is recomputed and any
105+
registered notifiers are called only if the target value is now different.
106+
Clients of dev_pm_qos need to save the handle for future use in other
107+
dev_pm_qos API functions.
108+
109+
int dev_pm_qos_update_request(handle, new_value):
110+
Will update the list element pointed to by the handle with the new target value
111+
and recompute the new aggregated target, calling the notification trees if the
112+
target is changed.
113+
114+
int dev_pm_qos_remove_request(handle):
115+
Will remove the element. After removal it will update the aggregate target and
116+
call the notification trees if the target was changed as a result of removing
117+
the request.
118+
119+
s32 dev_pm_qos_read_value(device):
120+
Returns the aggregated value for a given device's constraints list.
121+
122+
123+
Notification mechanisms:
124+
The per-device PM QoS framework has 2 different and distinct notification trees:
125+
a per-device notification tree and a global notification tree.
126+
127+
int dev_pm_qos_add_notifier(device, notifier):
128+
Adds a notification callback function for the device.
129+
The callback is called when the aggregated value of the device constraints list
130+
is changed.
131+
132+
int dev_pm_qos_remove_notifier(device, notifier):
133+
Removes the notification callback function for the device.
134+
135+
int dev_pm_qos_add_global_notifier(notifier):
136+
Adds a notification callback function in the global notification tree of the
137+
framework.
138+
The callback is called when the aggregated value for any device is changed.
139+
140+
int dev_pm_qos_remove_global_notifier(notifier):
141+
Removes the notification callback function from the global notification tree
142+
of the framework.
143+
144+
145+
From user mode:
146+
No API for user space access to the per-device latency constraints is provided
147+
yet - still under discussion.
66148

‎Documentation/power/runtime_pm.txt‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,18 @@ struct dev_pm_ops {
4343
...
4444
};
4545

46-
The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks are
47-
executed by the PM core for either the device type, or the class (if the device
48-
type's struct dev_pm_ops object does not exist), or the bus type (if the
49-
device type's and class' struct dev_pm_ops objects do not exist) of the given
50-
device (this allows device types to override callbacks provided by bus types or
51-
classes if necessary). The bus type, device type and class callbacks are
52-
referred to as subsystem-level callbacks in what follows.
46+
The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks
47+
are executed by the PM core for either the power domain, or the device type
48+
(if the device power domain's struct dev_pm_ops does not exist), or the class
49+
(if the device power domain's and type's struct dev_pm_ops object does not
50+
exist), or the bus type (if the device power domain's, type's and class'
51+
struct dev_pm_ops objects do not exist) of the given device, so the priority
52+
order of callbacks from high to low is that power domain callbacks, device
53+
type callbacks, class callbacks and bus type callbacks, and the high priority
54+
one will take precedence over low priority one. The bus type, device type and
55+
class callbacks are referred to as subsystem-level callbacks in what follows,
56+
and generally speaking, the power domain callbacks are used for representing
57+
power domains within a SoC.
5358

5459
By default, the callbacks are always invoked in process context with interrupts
5560
enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
@@ -477,12 +482,14 @@ pm_runtime_autosuspend_expiration()
477482
If pm_runtime_irq_safe() has been called for a device then the following helper
478483
functions may also be used in interrupt context:
479484

485+
pm_runtime_idle()
480486
pm_runtime_suspend()
481487
pm_runtime_autosuspend()
482488
pm_runtime_resume()
483489
pm_runtime_get_sync()
484490
pm_runtime_put_sync()
485491
pm_runtime_put_sync_suspend()
492+
pm_runtime_put_sync_autosuspend()
486493

487494
5. Runtime PM Initialization, Device Probing and Removal
488495

0 commit comments

Comments
 (0)