aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-02-08 17:26:02 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-03-14 19:43:14 -0400
commitcb8f51bdadb7969139c2e39c2defd4cde98c1ea8 (patch)
treea6d6e20878460d50b8f61d5fe3237818c54065eb /Documentation
parent4681b17154b3fd81f898802262985f662344e6ed (diff)
PM: Do not create wakeup sysfs files for devices that cannot wake up
Currently, wakeup sysfs attributes are created for all devices, regardless of whether or not they are wakeup-capable. This is excessive and complicates wakeup device identification from user space (i.e. to identify wakeup-capable devices user space has to read /sys/devices/.../power/wakeup for all devices and see if they are not empty). Fix this issue by avoiding to create wakeup sysfs files for devices that cannot wake up the system from sleep states (i.e. whose power.can_wakeup flags are unset during registration) and modify device_set_wakeup_capable() so that it adds (or removes) the relevant sysfs attributes if a device's wakeup capability status is changed. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/sysfs-devices-power20
-rw-r--r--Documentation/power/devices.txt20
2 files changed, 20 insertions, 20 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power
index 7628cd1bc36a..8ffbc25376a0 100644
--- a/Documentation/ABI/testing/sysfs-devices-power
+++ b/Documentation/ABI/testing/sysfs-devices-power
@@ -29,9 +29,8 @@ Description:
29 "disabled" to it. 29 "disabled" to it.
30 30
31 For the devices that are not capable of generating system wakeup 31 For the devices that are not capable of generating system wakeup
32 events this file contains "\n". In that cases the user space 32 events this file is not present. In that case the device cannot
33 cannot modify the contents of this file and the device cannot be 33 be enabled to wake up the system from sleep states.
34 enabled to wake up the system.
35 34
36What: /sys/devices/.../power/control 35What: /sys/devices/.../power/control
37Date: January 2009 36Date: January 2009
@@ -85,7 +84,7 @@ Description:
85 The /sys/devices/.../wakeup_count attribute contains the number 84 The /sys/devices/.../wakeup_count attribute contains the number
86 of signaled wakeup events associated with the device. This 85 of signaled wakeup events associated with the device. This
87 attribute is read-only. If the device is not enabled to wake up 86 attribute is read-only. If the device is not enabled to wake up
88 the system from sleep states, this attribute is empty. 87 the system from sleep states, this attribute is not present.
89 88
90What: /sys/devices/.../power/wakeup_active_count 89What: /sys/devices/.../power/wakeup_active_count
91Date: September 2010 90Date: September 2010
@@ -95,7 +94,7 @@ Description:
95 number of times the processing of wakeup events associated with 94 number of times the processing of wakeup events associated with
96 the device was completed (at the kernel level). This attribute 95 the device was completed (at the kernel level). This attribute
97 is read-only. If the device is not enabled to wake up the 96 is read-only. If the device is not enabled to wake up the
98 system from sleep states, this attribute is empty. 97 system from sleep states, this attribute is not present.
99 98
100What: /sys/devices/.../power/wakeup_hit_count 99What: /sys/devices/.../power/wakeup_hit_count
101Date: September 2010 100Date: September 2010
@@ -105,7 +104,8 @@ Description:
105 number of times the processing of a wakeup event associated with 104 number of times the processing of a wakeup event associated with
106 the device might prevent the system from entering a sleep state. 105 the device might prevent the system from entering a sleep state.
107 This attribute is read-only. If the device is not enabled to 106 This attribute is read-only. If the device is not enabled to
108 wake up the system from sleep states, this attribute is empty. 107 wake up the system from sleep states, this attribute is not
108 present.
109 109
110What: /sys/devices/.../power/wakeup_active 110What: /sys/devices/.../power/wakeup_active
111Date: September 2010 111Date: September 2010
@@ -115,7 +115,7 @@ Description:
115 or 0, depending on whether or not a wakeup event associated with 115 or 0, depending on whether or not a wakeup event associated with
116 the device is being processed (1). This attribute is read-only. 116 the device is being processed (1). This attribute is read-only.
117 If the device is not enabled to wake up the system from sleep 117 If the device is not enabled to wake up the system from sleep
118 states, this attribute is empty. 118 states, this attribute is not present.
119 119
120What: /sys/devices/.../power/wakeup_total_time_ms 120What: /sys/devices/.../power/wakeup_total_time_ms
121Date: September 2010 121Date: September 2010
@@ -125,7 +125,7 @@ Description:
125 the total time of processing wakeup events associated with the 125 the total time of processing wakeup events associated with the
126 device, in milliseconds. This attribute is read-only. If the 126 device, in milliseconds. This attribute is read-only. If the
127 device is not enabled to wake up the system from sleep states, 127 device is not enabled to wake up the system from sleep states,
128 this attribute is empty. 128 this attribute is not present.
129 129
130What: /sys/devices/.../power/wakeup_max_time_ms 130What: /sys/devices/.../power/wakeup_max_time_ms
131Date: September 2010 131Date: September 2010
@@ -135,7 +135,7 @@ Description:
135 the maximum time of processing a single wakeup event associated 135 the maximum time of processing a single wakeup event associated
136 with the device, in milliseconds. This attribute is read-only. 136 with the device, in milliseconds. This attribute is read-only.
137 If the device is not enabled to wake up the system from sleep 137 If the device is not enabled to wake up the system from sleep
138 states, this attribute is empty. 138 states, this attribute is not present.
139 139
140What: /sys/devices/.../power/wakeup_last_time_ms 140What: /sys/devices/.../power/wakeup_last_time_ms
141Date: September 2010 141Date: September 2010
@@ -146,7 +146,7 @@ Description:
146 signaling the last wakeup event associated with the device, in 146 signaling the last wakeup event associated with the device, in
147 milliseconds. This attribute is read-only. If the device is 147 milliseconds. This attribute is read-only. If the device is
148 not enabled to wake up the system from sleep states, this 148 not enabled to wake up the system from sleep states, this
149 attribute is empty. 149 attribute is not present.
150 150
151What: /sys/devices/.../power/autosuspend_delay_ms 151What: /sys/devices/.../power/autosuspend_delay_ms
152Date: September 2010 152Date: September 2010
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
index 57080cd74575..dd9b49251db3 100644
--- a/Documentation/power/devices.txt
+++ b/Documentation/power/devices.txt
@@ -159,18 +159,18 @@ matter, and the kernel is responsible for keeping track of it. By contrast,
159whether or not a wakeup-capable device should issue wakeup events is a policy 159whether or not a wakeup-capable device should issue wakeup events is a policy
160decision, and it is managed by user space through a sysfs attribute: the 160decision, and it is managed by user space through a sysfs attribute: the
161power/wakeup file. User space can write the strings "enabled" or "disabled" to 161power/wakeup file. User space can write the strings "enabled" or "disabled" to
162set or clear the should_wakeup flag, respectively. Reads from the file will 162set or clear the "should_wakeup" flag, respectively. This file is only present
163return the corresponding string if can_wakeup is true, but if can_wakeup is 163for wakeup-capable devices (i.e. devices whose "can_wakeup" flags are set)
164false then reads will return an empty string, to indicate that the device 164and is created (or removed) by device_set_wakeup_capable(). Reads from the
165doesn't support wakeup events. (But even though the file appears empty, writes 165file will return the corresponding string.
166will still affect the should_wakeup flag.)
167 166
168The device_may_wakeup() routine returns true only if both flags are set. 167The device_may_wakeup() routine returns true only if both flags are set.
169Drivers should check this routine when putting devices in a low-power state 168This information is used by subsystems, like the PCI bus type code, to see
170during a system sleep transition, to see whether or not to enable the devices' 169whether or not to enable the devices' wakeup mechanisms. If device wakeup
171wakeup mechanisms. However for runtime power management, wakeup events should 170mechanisms are enabled or disabled directly by drivers, they also should use
172be enabled whenever the device and driver both support them, regardless of the 171device_may_wakeup() to decide what to do during a system sleep transition.
173should_wakeup flag. 172However for runtime power management, wakeup events should be enabled whenever
173the device and driver both support them, regardless of the should_wakeup flag.
174 174
175 175
176/sys/devices/.../power/control files 176/sys/devices/.../power/control files