Skip to content

Commit 151f4e2

Browse files
mchehabbjorn-helgaas
authored andcommitted
docs: power: convert docs to ReST and rename to *.rst
Convert the PM documents to ReST, in order to allow them to build with Sphinx. The conversion is actually: - add blank lines and indentation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Mark Brown <[email protected]> Acked-by: Srivatsa S. Bhat (VMware) <[email protected]>
1 parent 9595aee commit 151f4e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2132
-1711
lines changed

Documentation/ABI/testing/sysfs-class-powercap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Contact: [email protected]
55
Description:
66
The powercap/ class sub directory belongs to the power cap
77
subsystem. Refer to
8-
Documentation/power/powercap/powercap.txt for details.
8+
Documentation/power/powercap/powercap.rst for details.
99

1010
What: /sys/class/powercap/<control type>
1111
Date: September 2013

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
For ARM64, ONLY "acpi=off", "acpi=on" or "acpi=force"
1414
are available
1515

16-
See also Documentation/power/runtime_pm.txt, pci=noacpi
16+
See also Documentation/power/runtime_pm.rst, pci=noacpi
1717

1818
acpi_apic_instance= [ACPI, IOAPIC]
1919
Format: <int>
@@ -223,7 +223,7 @@
223223
acpi_sleep= [HW,ACPI] Sleep options
224224
Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig,
225225
old_ordering, nonvs, sci_force_enable, nobl }
226-
See Documentation/power/video.txt for information on
226+
See Documentation/power/video.rst for information on
227227
s3_bios and s3_mode.
228228
s3_beep is for debugging; it makes the PC's speaker beep
229229
as soon as the kernel's real-mode entry point is called.
@@ -4108,7 +4108,7 @@
41084108
Specify the offset from the beginning of the partition
41094109
given by "resume=" at which the swap header is located,
41104110
in <PAGE_SIZE> units (needed only for swap files).
4111-
See Documentation/power/swsusp-and-swap-files.txt
4111+
See Documentation/power/swsusp-and-swap-files.rst
41124112

41134113
resumedelay= [HIBERNATION] Delay (in seconds) to pause before attempting to
41144114
read the resume files

Documentation/cpu-freq/core.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ flags - flags of the cpufreq driver
9595

9696
3. CPUFreq Table Generation with Operating Performance Point (OPP)
9797
==================================================================
98-
For details about OPP, see Documentation/power/opp.txt
98+
For details about OPP, see Documentation/power/opp.rst
9999

100100
dev_pm_opp_init_cpufreq_table -
101101
This function provides a ready to use conversion routine to translate

Documentation/driver-api/pm/devices.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ system-wide transition to a sleep state even though its :c:member:`runtime_auto`
225225
flag is clear.
226226

227227
For more information about the runtime power management framework, refer to
228-
:file:`Documentation/power/runtime_pm.txt`.
228+
:file:`Documentation/power/runtime_pm.rst`.
229229

230230

231231
Calling Drivers to Enter and Leave System Sleep States
@@ -728,7 +728,7 @@ it into account in any way.
728728

729729
Devices may be defined as IRQ-safe which indicates to the PM core that their
730730
runtime PM callbacks may be invoked with disabled interrupts (see
731-
:file:`Documentation/power/runtime_pm.txt` for more information). If an
731+
:file:`Documentation/power/runtime_pm.rst` for more information). If an
732732
IRQ-safe device belongs to a PM domain, the runtime PM of the domain will be
733733
disallowed, unless the domain itself is defined as IRQ-safe. However, it
734734
makes sense to define a PM domain as IRQ-safe only if all the devices in it
@@ -795,7 +795,7 @@ so on) and the final state of the device must reflect the "active" runtime PM
795795
status in that case.
796796

797797
During system-wide resume from a sleep state it's easiest to put devices into
798-
the full-power state, as explained in :file:`Documentation/power/runtime_pm.txt`.
798+
the full-power state, as explained in :file:`Documentation/power/runtime_pm.rst`.
799799
[Refer to that document for more information regarding this particular issue as
800800
well as for information on the device runtime power management framework in
801801
general.]

Documentation/driver-api/usb/power-management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ device is turned off while the system as a whole remains running, we
4646
call it a "dynamic suspend" (also known as a "runtime suspend" or
4747
"selective suspend"). This document concentrates mostly on how
4848
dynamic PM is implemented in the USB subsystem, although system PM is
49-
covered to some extent (see ``Documentation/power/*.txt`` for more
49+
covered to some extent (see ``Documentation/power/*.rst`` for more
5050
information about system PM).
5151

5252
System PM support is present only if the kernel was built with

Documentation/power/apm-acpi.txt renamed to Documentation/power/apm-acpi.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
============
12
APM or ACPI?
2-
------------
3+
============
4+
35
If you have a relatively recent x86 mobile, desktop, or server system,
46
odds are it supports either Advanced Power Management (APM) or
57
Advanced Configuration and Power Interface (ACPI). ACPI is the newer
@@ -28,5 +30,7 @@ and be sure that they are started sometime in the system boot process.
2830
Go ahead and start both. If ACPI or APM is not available on your
2931
system the associated daemon will exit gracefully.
3032

31-
apmd: http://ftp.debian.org/pool/main/a/apmd/
32-
acpid: http://acpid.sf.net/
33+
===== =======================================
34+
apmd http://ftp.debian.org/pool/main/a/apmd/
35+
acpid http://acpid.sf.net/
36+
===== =======================================

Documentation/power/basic-pm-debugging.txt renamed to Documentation/power/basic-pm-debugging.rst

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
=================================
12
Debugging hibernation and suspend
3+
=================================
4+
25
(C) 2007 Rafael J. Wysocki <[email protected]>, GPL
36

47
1. Testing hibernation (aka suspend to disk or STD)
8+
===================================================
59

6-
To check if hibernation works, you can try to hibernate in the "reboot" mode:
10+
To check if hibernation works, you can try to hibernate in the "reboot" mode::
711

8-
# echo reboot > /sys/power/disk
9-
# echo disk > /sys/power/state
12+
# echo reboot > /sys/power/disk
13+
# echo disk > /sys/power/state
1014

1115
and the system should create a hibernation image, reboot, resume and get back to
1216
the command prompt where you have started the transition. If that happens,
@@ -15,20 +19,21 @@ test at least a couple of times in a row for confidence. [This is necessary,
1519
because some problems only show up on a second attempt at suspending and
1620
resuming the system.] Moreover, hibernating in the "reboot" and "shutdown"
1721
modes causes the PM core to skip some platform-related callbacks which on ACPI
18-
systems might be necessary to make hibernation work. Thus, if your machine fails
19-
to hibernate or resume in the "reboot" mode, you should try the "platform" mode:
22+
systems might be necessary to make hibernation work. Thus, if your machine
23+
fails to hibernate or resume in the "reboot" mode, you should try the
24+
"platform" mode::
2025

21-
# echo platform > /sys/power/disk
22-
# echo disk > /sys/power/state
26+
# echo platform > /sys/power/disk
27+
# echo disk > /sys/power/state
2328

2429
which is the default and recommended mode of hibernation.
2530

2631
Unfortunately, the "platform" mode of hibernation does not work on some systems
2732
with broken BIOSes. In such cases the "shutdown" mode of hibernation might
28-
work:
33+
work::
2934

30-
# echo shutdown > /sys/power/disk
31-
# echo disk > /sys/power/state
35+
# echo shutdown > /sys/power/disk
36+
# echo disk > /sys/power/state
3237

3338
(it is similar to the "reboot" mode, but it requires you to press the power
3439
button to make the system resume).
@@ -37,43 +42,46 @@ If neither "platform" nor "shutdown" hibernation mode works, you will need to
3742
identify what goes wrong.
3843

3944
a) Test modes of hibernation
45+
----------------------------
4046

4147
To find out why hibernation fails on your system, you can use a special testing
4248
facility available if the kernel is compiled with CONFIG_PM_DEBUG set. Then,
4349
there is the file /sys/power/pm_test that can be used to make the hibernation
4450
core run in a test mode. There are 5 test modes available:
4551

4652
freezer
47-
- test the freezing of processes
53+
- test the freezing of processes
4854

4955
devices
50-
- test the freezing of processes and suspending of devices
56+
- test the freezing of processes and suspending of devices
5157

5258
platform
53-
- test the freezing of processes, suspending of devices and platform
54-
global control methods(*)
59+
- test the freezing of processes, suspending of devices and platform
60+
global control methods [1]_
5561

5662
processors
57-
- test the freezing of processes, suspending of devices, platform
58-
global control methods(*) and the disabling of nonboot CPUs
63+
- test the freezing of processes, suspending of devices, platform
64+
global control methods [1]_ and the disabling of nonboot CPUs
5965

6066
core
61-
- test the freezing of processes, suspending of devices, platform global
62-
control methods(*), the disabling of nonboot CPUs and suspending of
63-
platform/system devices
67+
- test the freezing of processes, suspending of devices, platform global
68+
control methods\ [1]_, the disabling of nonboot CPUs and suspending
69+
of platform/system devices
70+
71+
.. [1]
6472
65-
(*) the platform global control methods are only available on ACPI systems
73+
the platform global control methods are only available on ACPI systems
6674
and are only tested if the hibernation mode is set to "platform"
6775
6876
To use one of them it is necessary to write the corresponding string to
6977
/sys/power/pm_test (eg. "devices" to test the freezing of processes and
7078
suspending devices) and issue the standard hibernation commands. For example,
7179
to use the "devices" test mode along with the "platform" mode of hibernation,
72-
you should do the following:
80+
you should do the following::
7381

74-
# echo devices > /sys/power/pm_test
75-
# echo platform > /sys/power/disk
76-
# echo disk > /sys/power/state
82+
# echo devices > /sys/power/pm_test
83+
# echo platform > /sys/power/disk
84+
# echo disk > /sys/power/state
7785

7886
Then, the kernel will try to freeze processes, suspend devices, wait a few
7987
seconds (5 by default, but configurable by the suspend.pm_test_delay module
@@ -108,11 +116,12 @@ If the "devices" test fails, most likely there is a driver that cannot suspend
108116
or resume its device (in the latter case the system may hang or become unstable
109117
after the test, so please take that into consideration). To find this driver,
110118
you can carry out a binary search according to the rules:
119+
111120
- if the test fails, unload a half of the drivers currently loaded and repeat
112-
(that would probably involve rebooting the system, so always note what drivers
113-
have been loaded before the test),
121+
(that would probably involve rebooting the system, so always note what drivers
122+
have been loaded before the test),
114123
- if the test succeeds, load a half of the drivers you have unloaded most
115-
recently and repeat.
124+
recently and repeat.
116125

117126
Once you have found the failing driver (there can be more than just one of
118127
them), you have to unload it every time before hibernation. In that case please
@@ -146,6 +155,7 @@ indicates a serious problem that very well may be related to the hardware, but
146155
please report it anyway.
147156

148157
b) Testing minimal configuration
158+
--------------------------------
149159

150160
If all of the hibernation test modes work, you can boot the system with the
151161
"init=/bin/bash" command line parameter and attempt to hibernate in the
@@ -165,14 +175,15 @@ Again, if you find the offending module(s), it(they) must be unloaded every time
165175
before hibernation, and please report the problem with it(them).
166176

167177
c) Using the "test_resume" hibernation option
178+
---------------------------------------------
168179

169180
/sys/power/disk generally tells the kernel what to do after creating a
170181
hibernation image. One of the available options is "test_resume" which
171182
causes the just created image to be used for immediate restoration. Namely,
172-
after doing:
183+
after doing::
173184

174-
# echo test_resume > /sys/power/disk
175-
# echo disk > /sys/power/state
185+
# echo test_resume > /sys/power/disk
186+
# echo disk > /sys/power/state
176187

177188
a hibernation image will be created and a resume from it will be triggered
178189
immediately without involving the platform firmware in any way.
@@ -190,6 +201,7 @@ to resume may be related to the differences between the restore and image
190201
kernels.
191202

192203
d) Advanced debugging
204+
---------------------
193205

194206
In case that hibernation does not work on your system even in the minimal
195207
configuration and compiling more drivers as modules is not practical or some
@@ -200,9 +212,10 @@ kernel messages using the serial console. This may provide you with some
200212
information about the reasons of the suspend (resume) failure. Alternatively,
201213
it may be possible to use a FireWire port for debugging with firescope
202214
(http://v3.sk/~lkundrak/firescope/). On x86 it is also possible to
203-
use the PM_TRACE mechanism documented in Documentation/power/s2ram.txt .
215+
use the PM_TRACE mechanism documented in Documentation/power/s2ram.rst .
204216

205217
2. Testing suspend to RAM (STR)
218+
===============================
206219

207220
To verify that the STR works, it is generally more convenient to use the s2ram
208221
tool available from http://suspend.sf.net and documented at
@@ -230,7 +243,8 @@ you will have to unload them every time before an STR transition (ie. before
230243
you run s2ram), and please report the problems with them.
231244

232245
There is a debugfs entry which shows the suspend to RAM statistics. Here is an
233-
example of its output.
246+
example of its output::
247+
234248
# mount -t debugfs none /sys/kernel/debug
235249
# cat /sys/kernel/debug/suspend_stats
236250
success: 20
@@ -248,6 +262,7 @@ example of its output.
248262
-16
249263
last_failed_step: suspend
250264
suspend
265+
251266
Field success means the success number of suspend to RAM, and field fail means
252267
the failure number. Others are the failure number of different steps of suspend
253268
to RAM. suspend_stats just lists the last 2 failed devices, error number and

0 commit comments

Comments
 (0)