Skip to content

Commit e350b60

Browse files
committed
Merge branches 'pm-avs', 'pm-docs' and 'pm-tools'
* pm-avs: ARM: OMAP2+: SmartReflex: add omap_sr_pdata definition power: avs: smartreflex: Remove superfluous cast in debugfs_create_file() call * pm-docs: PM: Wrap documentation to fit in 80 columns * pm-tools: cpupower: ToDo: Update ToDo with ideas for per_cpu_schedule handling cpupower: mperf_monitor: Update cpupower to use the RDPRU instruction cpupower: mperf_monitor: Introduce per_cpu_schedule flag cpupower: Move needs_root variable into a sub-struct cpupower : Handle set and info subcommands correctly pm-graph info added to MAINTAINERS tools/power/cpupower: Fix initializer override in hsw_ext_cstates
4 parents 5a97aa5 + 2079fe6 + 1992b66 + 9581e24 commit e350b60

24 files changed

+194
-94
lines changed

Documentation/power/drivers-testing.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ c) Compile the driver directly into the kernel and try the test modes of
3939
d) Attempt to hibernate with the driver compiled directly into the kernel
4040
in the "reboot", "shutdown" and "platform" modes.
4141

42-
e) Try the test modes of suspend (see: Documentation/power/basic-pm-debugging.rst,
43-
2). [As far as the STR tests are concerned, it should not matter whether or
44-
not the driver is built as a module.]
42+
e) Try the test modes of suspend (see:
43+
Documentation/power/basic-pm-debugging.rst, 2). [As far as the STR tests are
44+
concerned, it should not matter whether or not the driver is built as a
45+
module.]
4546

4647
f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
4748
(see: Documentation/power/basic-pm-debugging.rst, 2).

Documentation/power/freezing-of-tasks.rst

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -215,30 +215,31 @@ VI. Are there any precautions to be taken to prevent freezing failures?
215215

216216
Yes, there are.
217217

218-
First of all, grabbing the 'system_transition_mutex' lock to mutually exclude a piece of code
219-
from system-wide sleep such as suspend/hibernation is not encouraged.
220-
If possible, that piece of code must instead hook onto the suspend/hibernation
221-
notifiers to achieve mutual exclusion. Look at the CPU-Hotplug code
222-
(kernel/cpu.c) for an example.
223-
224-
However, if that is not feasible, and grabbing 'system_transition_mutex' is deemed necessary,
225-
it is strongly discouraged to directly call mutex_[un]lock(&system_transition_mutex) since
226-
that could lead to freezing failures, because if the suspend/hibernate code
227-
successfully acquired the 'system_transition_mutex' lock, and hence that other entity failed
228-
to acquire the lock, then that task would get blocked in TASK_UNINTERRUPTIBLE
229-
state. As a consequence, the freezer would not be able to freeze that task,
230-
leading to freezing failure.
218+
First of all, grabbing the 'system_transition_mutex' lock to mutually exclude a
219+
piece of code from system-wide sleep such as suspend/hibernation is not
220+
encouraged. If possible, that piece of code must instead hook onto the
221+
suspend/hibernation notifiers to achieve mutual exclusion. Look at the
222+
CPU-Hotplug code (kernel/cpu.c) for an example.
223+
224+
However, if that is not feasible, and grabbing 'system_transition_mutex' is
225+
deemed necessary, it is strongly discouraged to directly call
226+
mutex_[un]lock(&system_transition_mutex) since that could lead to freezing
227+
failures, because if the suspend/hibernate code successfully acquired the
228+
'system_transition_mutex' lock, and hence that other entity failed to acquire
229+
the lock, then that task would get blocked in TASK_UNINTERRUPTIBLE state. As a
230+
consequence, the freezer would not be able to freeze that task, leading to
231+
freezing failure.
231232

232233
However, the [un]lock_system_sleep() APIs are safe to use in this scenario,
233234
since they ask the freezer to skip freezing this task, since it is anyway
234-
"frozen enough" as it is blocked on 'system_transition_mutex', which will be released
235-
only after the entire suspend/hibernation sequence is complete.
236-
So, to summarize, use [un]lock_system_sleep() instead of directly using
235+
"frozen enough" as it is blocked on 'system_transition_mutex', which will be
236+
released only after the entire suspend/hibernation sequence is complete. So, to
237+
summarize, use [un]lock_system_sleep() instead of directly using
237238
mutex_[un]lock(&system_transition_mutex). That would prevent freezing failures.
238239

239240
V. Miscellaneous
240241
================
241242

242243
/sys/power/pm_freeze_timeout controls how long it will cost at most to freeze
243-
all user space processes or all freezable kernel threads, in unit of millisecond.
244-
The default value is 20000, with range of unsigned integer.
244+
all user space processes or all freezable kernel threads, in unit of
245+
millisecond. The default value is 20000, with range of unsigned integer.

Documentation/power/opp.rst

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,21 @@ factors. Example usage: Thermal management or other exceptional situations where
7373
SoC framework might choose to disable a higher frequency OPP to safely continue
7474
operations until that OPP could be re-enabled if possible.
7575

76-
OPP library facilitates this concept in it's implementation. The following
76+
OPP library facilitates this concept in its implementation. The following
7777
operational functions operate only on available opps:
78-
opp_find_freq_{ceil, floor}, dev_pm_opp_get_voltage, dev_pm_opp_get_freq, dev_pm_opp_get_opp_count
78+
opp_find_freq_{ceil, floor}, dev_pm_opp_get_voltage, dev_pm_opp_get_freq,
79+
dev_pm_opp_get_opp_count
7980

80-
dev_pm_opp_find_freq_exact is meant to be used to find the opp pointer which can then
81-
be used for dev_pm_opp_enable/disable functions to make an opp available as required.
81+
dev_pm_opp_find_freq_exact is meant to be used to find the opp pointer
82+
which can then be used for dev_pm_opp_enable/disable functions to make an
83+
opp available as required.
8284

8385
WARNING: Users of OPP library should refresh their availability count using
84-
get_opp_count if dev_pm_opp_enable/disable functions are invoked for a device, the
85-
exact mechanism to trigger these or the notification mechanism to other
86-
dependent subsystems such as cpufreq are left to the discretion of the SoC
87-
specific framework which uses the OPP library. Similar care needs to be taken
88-
care to refresh the cpufreq table in cases of these operations.
86+
get_opp_count if dev_pm_opp_enable/disable functions are invoked for a
87+
device, the exact mechanism to trigger these or the notification mechanism
88+
to other dependent subsystems such as cpufreq are left to the discretion of
89+
the SoC specific framework which uses the OPP library. Similar care needs
90+
to be taken care to refresh the cpufreq table in cases of these operations.
8991

9092
2. Initial OPP List Registration
9193
================================
@@ -99,11 +101,11 @@ OPPs dynamically using the dev_pm_opp_enable / disable functions.
99101
dev_pm_opp_add
100102
Add a new OPP for a specific domain represented by the device pointer.
101103
The OPP is defined using the frequency and voltage. Once added, the OPP
102-
is assumed to be available and control of it's availability can be done
103-
with the dev_pm_opp_enable/disable functions. OPP library internally stores
104-
and manages this information in the opp struct. This function may be
105-
used by SoC framework to define a optimal list as per the demands of
106-
SoC usage environment.
104+
is assumed to be available and control of its availability can be done
105+
with the dev_pm_opp_enable/disable functions. OPP library
106+
internally stores and manages this information in the opp struct.
107+
This function may be used by SoC framework to define a optimal list
108+
as per the demands of SoC usage environment.
107109

108110
WARNING:
109111
Do not use this function in interrupt context.
@@ -354,7 +356,7 @@ struct dev_pm_opp
354356

355357
struct device
356358
This is used to identify a domain to the OPP layer. The
357-
nature of the device and it's implementation is left to the user of
359+
nature of the device and its implementation is left to the user of
358360
OPP library such as the SoC framework.
359361

360362
Overall, in a simplistic view, the data structure operations is represented as

Documentation/power/pci.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,12 @@ pm->runtime_idle() callback.
426426
2.4. System-Wide Power Transitions
427427
----------------------------------
428428
There are a few different types of system-wide power transitions, described in
429-
Documentation/driver-api/pm/devices.rst. Each of them requires devices to be handled
430-
in a specific way and the PM core executes subsystem-level power management
431-
callbacks for this purpose. They are executed in phases such that each phase
432-
involves executing the same subsystem-level callback for every device belonging
433-
to the given subsystem before the next phase begins. These phases always run
434-
after tasks have been frozen.
429+
Documentation/driver-api/pm/devices.rst. Each of them requires devices to be
430+
handled in a specific way and the PM core executes subsystem-level power
431+
management callbacks for this purpose. They are executed in phases such that
432+
each phase involves executing the same subsystem-level callback for every device
433+
belonging to the given subsystem before the next phase begins. These phases
434+
always run after tasks have been frozen.
435435

436436
2.4.1. System Suspend
437437
^^^^^^^^^^^^^^^^^^^^^
@@ -636,12 +636,12 @@ System restore requires a hibernation image to be loaded into memory and the
636636
pre-hibernation memory contents to be restored before the pre-hibernation system
637637
activity can be resumed.
638638

639-
As described in Documentation/driver-api/pm/devices.rst, the hibernation image is loaded
640-
into memory by a fresh instance of the kernel, called the boot kernel, which in
641-
turn is loaded and run by a boot loader in the usual way. After the boot kernel
642-
has loaded the image, it needs to replace its own code and data with the code
643-
and data of the "hibernated" kernel stored within the image, called the image
644-
kernel. For this purpose all devices are frozen just like before creating
639+
As described in Documentation/driver-api/pm/devices.rst, the hibernation image
640+
is loaded into memory by a fresh instance of the kernel, called the boot kernel,
641+
which in turn is loaded and run by a boot loader in the usual way. After the
642+
boot kernel has loaded the image, it needs to replace its own code and data with
643+
the code and data of the "hibernated" kernel stored within the image, called the
644+
image kernel. For this purpose all devices are frozen just like before creating
645645
the image during hibernation, in the
646646

647647
prepare, freeze, freeze_noirq
@@ -691,8 +691,8 @@ controlling the runtime power management of their devices.
691691

692692
At the time of this writing there are two ways to define power management
693693
callbacks for a PCI device driver, the recommended one, based on using a
694-
dev_pm_ops structure described in Documentation/driver-api/pm/devices.rst, and the
695-
"legacy" one, in which the .suspend(), .suspend_late(), .resume_early(), and
694+
dev_pm_ops structure described in Documentation/driver-api/pm/devices.rst, and
695+
the "legacy" one, in which the .suspend(), .suspend_late(), .resume_early(), and
696696
.resume() callbacks from struct pci_driver are used. The legacy approach,
697697
however, doesn't allow one to define runtime power management callbacks and is
698698
not really suitable for any new drivers. Therefore it is not covered by this

Documentation/power/pm_qos_interface.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ one of the parameters.
88

99
Two different PM QoS frameworks are available:
1010
1. PM QoS classes for cpu_dma_latency
11-
2. the per-device PM QoS framework provides the API to manage the per-device latency
12-
constraints and PM QoS flags.
11+
2. The per-device PM QoS framework provides the API to manage the
12+
per-device latency constraints and PM QoS flags.
1313

1414
Each parameters have defined units:
1515

@@ -47,14 +47,14 @@ void pm_qos_add_request(handle, param_class, target_value):
4747
pm_qos API functions.
4848

4949
void pm_qos_update_request(handle, new_target_value):
50-
Will update the list element pointed to by the handle with the new target value
51-
and recompute the new aggregated target, calling the notification tree if the
52-
target is changed.
50+
Will update the list element pointed to by the handle with the new target
51+
value and recompute the new aggregated target, calling the notification tree
52+
if the target is changed.
5353

5454
void pm_qos_remove_request(handle):
55-
Will remove the element. After removal it will update the aggregate target and
56-
call the notification tree if the target was changed as a result of removing
57-
the request.
55+
Will remove the element. After removal it will update the aggregate target
56+
and call the notification tree if the target was changed as a result of
57+
removing the request.
5858

5959
int pm_qos_request(param_class):
6060
Returns the aggregated value for a given PM QoS class.
@@ -167,9 +167,9 @@ int dev_pm_qos_expose_flags(device, value)
167167
change the value of the PM_QOS_FLAG_NO_POWER_OFF flag.
168168

169169
void dev_pm_qos_hide_flags(device)
170-
Drop the request added by dev_pm_qos_expose_flags() from the device's PM QoS list
171-
of flags and remove sysfs attribute pm_qos_no_power_off from the device's power
172-
directory.
170+
Drop the request added by dev_pm_qos_expose_flags() from the device's PM QoS
171+
list of flags and remove sysfs attribute pm_qos_no_power_off from the device's
172+
power directory.
173173

174174
Notification mechanisms:
175175

@@ -179,8 +179,8 @@ int dev_pm_qos_add_notifier(device, notifier, type):
179179
Adds a notification callback function for the device for a particular request
180180
type.
181181

182-
The callback is called when the aggregated value of the device constraints list
183-
is changed.
182+
The callback is called when the aggregated value of the device constraints
183+
list is changed.
184184

185185
int dev_pm_qos_remove_notifier(device, notifier, type):
186186
Removes the notification callback function for the device.

Documentation/power/runtime_pm.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ defined in include/linux/pm.h:
268268
`unsigned int runtime_auto;`
269269
- if set, indicates that the user space has allowed the device driver to
270270
power manage the device at run time via the /sys/devices/.../power/control
271-
`interface;` it may only be modified with the help of the pm_runtime_allow()
272-
and pm_runtime_forbid() helper functions
271+
`interface;` it may only be modified with the help of the
272+
pm_runtime_allow() and pm_runtime_forbid() helper functions
273273

274274
`unsigned int no_callbacks;`
275275
- indicates that the device does not use the runtime PM callbacks (see

Documentation/power/suspend-and-cpuhotplug.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ execution during resume):
106106
* Release system_transition_mutex lock.
107107

108108

109-
It is to be noted here that the system_transition_mutex lock is acquired at the very
110-
beginning, when we are just starting out to suspend, and then released only
109+
It is to be noted here that the system_transition_mutex lock is acquired at the
110+
very beginning, when we are just starting out to suspend, and then released only
111111
after the entire cycle is complete (i.e., suspend + resume).
112112

113113
::
@@ -165,7 +165,8 @@ Important files and functions/entry points:
165165

166166
- kernel/power/process.c : freeze_processes(), thaw_processes()
167167
- kernel/power/suspend.c : suspend_prepare(), suspend_enter(), suspend_finish()
168-
- kernel/cpu.c: cpu_[up|down](), _cpu_[up|down](), [disable|enable]_nonboot_cpus()
168+
- kernel/cpu.c: cpu_[up|down](), _cpu_[up|down](),
169+
[disable|enable]_nonboot_cpus()
169170

170171

171172

Documentation/power/swsusp.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ In a really perfect world::
118118

119119
echo 1 > /proc/acpi/sleep # for standby
120120
echo 2 > /proc/acpi/sleep # for suspend to ram
121-
echo 3 > /proc/acpi/sleep # for suspend to ram, but with more power conservative
121+
echo 3 > /proc/acpi/sleep # for suspend to ram, but with more power
122+
# conservative
122123
echo 4 > /proc/acpi/sleep # for suspend to disk
123124
echo 5 > /proc/acpi/sleep # for shutdown unfriendly the system
124125

@@ -192,8 +193,8 @@ Q:
192193

193194
A:
194195
The freezing of tasks is a mechanism by which user space processes and some
195-
kernel threads are controlled during hibernation or system-wide suspend (on some
196-
architectures). See freezing-of-tasks.txt for details.
196+
kernel threads are controlled during hibernation or system-wide suspend (on
197+
some architectures). See freezing-of-tasks.txt for details.
197198

198199
Q:
199200
What is the difference between "platform" and "shutdown"?
@@ -282,7 +283,8 @@ A:
282283
suspend(PMSG_FREEZE): devices are frozen so that they don't interfere
283284
with state snapshot
284285

285-
state snapshot: copy of whole used memory is taken with interrupts disabled
286+
state snapshot: copy of whole used memory is taken with interrupts
287+
disabled
286288

287289
resume(): devices are woken up so that we can write image to swap
288290

@@ -353,8 +355,8 @@ Q:
353355

354356
A:
355357
Generally, yes, you can. However, it requires you to use the "resume=" and
356-
"resume_offset=" kernel command line parameters, so the resume from a swap file
357-
cannot be initiated from an initrd or initramfs image. See
358+
"resume_offset=" kernel command line parameters, so the resume from a swap
359+
file cannot be initiated from an initrd or initramfs image. See
358360
swsusp-and-swap-files.txt for details.
359361

360362
Q:

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13000,6 +13000,15 @@ L: [email protected]
1300013000
S: Supported
1300113001
F: drivers/scsi/pm8001/
1300213002

13003+
PM-GRAPH UTILITY
13004+
M: "Todd E Brandt" <[email protected]>
13005+
13006+
W: https://01.org/pm-graph
13007+
B: https://bugzilla.kernel.org/buglist.cgi?component=pm-graph&product=Tools
13008+
T: git git://github.com/intel/pm-graph
13009+
S: Supported
13010+
F: tools/power/pm-graph
13011+
1300313012
PNP SUPPORT
1300413013
M: "Rafael J. Wysocki" <[email protected]>
1300513014
S: Maintained

drivers/power/avs/smartreflex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ static int omap_sr_probe(struct platform_device *pdev)
905905
sr_info->dbg_dir = debugfs_create_dir(sr_info->name, sr_dbg_dir);
906906

907907
debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, sr_info->dbg_dir,
908-
(void *)sr_info, &pm_sr_fops);
908+
sr_info, &pm_sr_fops);
909909
debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
910910
&sr_info->err_weight);
911911
debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,

0 commit comments

Comments
 (0)