summaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-02-01 19:38:54 -0500
committerJonathan Corbet <corbet@lwn.net>2017-02-06 13:26:02 -0500
commit730c4c053012b058ccb5393bbc1691e4e872e741 (patch)
tree7998b44dc154c4e3389d832bbcbd905722a1b712 /Documentation/power
parent2728b2d2e5be4b828a523a06089cd605419fc65c (diff)
PM / sleep / docs: Convert PM notifiers document to reST
Move the document describing PM notifiers (used during system sleep state transitions) to Documentation/driver-api/pm/, convert it to reST and update it to use current terminology. Also replace the remaining references to the old version of it in .txt documents with references to the new one. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/00-INDEX2
-rw-r--r--Documentation/power/freezing-of-tasks.txt3
-rw-r--r--Documentation/power/notifiers.txt55
-rw-r--r--Documentation/power/pci.txt2
4 files changed, 3 insertions, 59 deletions
diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX
index 7cb6085839f3..7f3c2def2cac 100644
--- a/Documentation/power/00-INDEX
+++ b/Documentation/power/00-INDEX
@@ -14,8 +14,6 @@ freezing-of-tasks.txt
14 - How processes and controlled during suspend 14 - How processes and controlled during suspend
15interface.txt 15interface.txt
16 - Power management user interface in /sys/power 16 - Power management user interface in /sys/power
17notifiers.txt
18 - Registering suspend notifiers in device drivers
19opp.txt 17opp.txt
20 - Operating Performance Point library 18 - Operating Performance Point library
21pci.txt 19pci.txt
diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
index 85894d83b352..af005770e767 100644
--- a/Documentation/power/freezing-of-tasks.txt
+++ b/Documentation/power/freezing-of-tasks.txt
@@ -197,7 +197,8 @@ tasks, since it generally exists anyway.
197 197
198A driver must have all firmwares it may need in RAM before suspend() is called. 198A driver must have all firmwares it may need in RAM before suspend() is called.
199If keeping them is not practical, for example due to their size, they must be 199If keeping them is not practical, for example due to their size, they must be
200requested early enough using the suspend notifier API described in notifiers.txt. 200requested early enough using the suspend notifier API described in
201Documentation/driver-api/pm/notifiers.rst.
201 202
202VI. Are there any precautions to be taken to prevent freezing failures? 203VI. Are there any precautions to be taken to prevent freezing failures?
203 204
diff --git a/Documentation/power/notifiers.txt b/Documentation/power/notifiers.txt
deleted file mode 100644
index a81fa254303d..000000000000
--- a/Documentation/power/notifiers.txt
+++ /dev/null
@@ -1,55 +0,0 @@
1Suspend notifiers
2 (C) 2007-2011 Rafael J. Wysocki <rjw@sisk.pl>, GPL
3
4There are some operations that subsystems or drivers may want to carry out
5before hibernation/suspend or after restore/resume, but they require the system
6to be fully functional, so the drivers' and subsystems' .suspend() and .resume()
7or even .prepare() and .complete() callbacks are not suitable for this purpose.
8For example, device drivers may want to upload firmware to their devices after
9resume/restore, but they cannot do it by calling request_firmware() from their
10.resume() or .complete() routines (user land processes are frozen at these
11points). The solution may be to load the firmware into memory before processes
12are frozen and upload it from there in the .resume() routine.
13A suspend/hibernation notifier may be used for this purpose.
14
15The subsystems or drivers having such needs can register suspend notifiers that
16will be called upon the following events by the PM core:
17
18PM_HIBERNATION_PREPARE The system is going to hibernate, tasks will be frozen
19 immediately. This is different from PM_SUSPEND_PREPARE
20 below because here we do additional work between notifiers
21 and drivers freezing.
22
23PM_POST_HIBERNATION The system memory state has been restored from a
24 hibernation image or an error occurred during
25 hibernation. Device drivers' restore callbacks have
26 been executed and tasks have been thawed.
27
28PM_RESTORE_PREPARE The system is going to restore a hibernation image.
29 If all goes well, the restored kernel will issue a
30 PM_POST_HIBERNATION notification.
31
32PM_POST_RESTORE An error occurred during restore from hibernation.
33 Device drivers' restore callbacks have been executed
34 and tasks have been thawed.
35
36PM_SUSPEND_PREPARE The system is preparing for suspend.
37
38PM_POST_SUSPEND The system has just resumed or an error occurred during
39 suspend. Device drivers' resume callbacks have been
40 executed and tasks have been thawed.
41
42It is generally assumed that whatever the notifiers do for
43PM_HIBERNATION_PREPARE, should be undone for PM_POST_HIBERNATION. Analogously,
44operations performed for PM_SUSPEND_PREPARE should be reversed for
45PM_POST_SUSPEND. Additionally, all of the notifiers are called for
46PM_POST_HIBERNATION if one of them fails for PM_HIBERNATION_PREPARE, and
47all of the notifiers are called for PM_POST_SUSPEND if one of them fails for
48PM_SUSPEND_PREPARE.
49
50The hibernation and suspend notifiers are called with pm_mutex held. They are
51defined in the usual way, but their last argument is meaningless (it is always
52NULL). To register and/or unregister a suspend notifier use the functions
53register_pm_notifier() and unregister_pm_notifier(), respectively, defined in
54include/linux/suspend.h . If you don't need to unregister the notifier, you can
55also use the pm_notifier() macro defined in include/linux/suspend.h .
diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt
index 85c746cbab2c..a1b7f7158930 100644
--- a/Documentation/power/pci.txt
+++ b/Documentation/power/pci.txt
@@ -713,7 +713,7 @@ In addition to that the prepare() callback may carry out some operations
713preparing the device to be suspended, although it should not allocate memory 713preparing the device to be suspended, although it should not allocate memory
714(if additional memory is required to suspend the device, it has to be 714(if additional memory is required to suspend the device, it has to be
715preallocated earlier, for example in a suspend/hibernate notifier as described 715preallocated earlier, for example in a suspend/hibernate notifier as described
716in Documentation/power/notifiers.txt). 716in Documentation/driver-api/pm/notifiers.rst).
717 717
7183.1.2. suspend() 7183.1.2. suspend()
719 719