<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/power/sysfs.c, branch v3.0.85</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/base/power/sysfs.c?h=v3.0.85</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/base/power/sysfs.c?h=v3.0.85'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-05-17T21:19:18Z</updated>
<entry>
<title>PM / Wakeup: Fix build warning related to the "wakeup" sysfs file</title>
<updated>2011-05-17T21:19:18Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-05-07T16:11:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e762318baae3002944d68220910aef7caffcd065'/>
<id>urn:sha1:e762318baae3002944d68220910aef7caffcd065</id>
<content type='text'>
The "wakeup" device sysfs file is only created if CONFIG_PM_SLEEP
is set, so put it under CONFIG_PM_SLEEP and make a build warning
related to it go away.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>PM: Do not create wakeup sysfs files for devices that cannot wake up</title>
<updated>2011-03-14T23:43:14Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-02-08T22:26:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cb8f51bdadb7969139c2e39c2defd4cde98c1ea8'/>
<id>urn:sha1:cb8f51bdadb7969139c2e39c2defd4cde98c1ea8</id>
<content type='text'>
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 &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Implement autosuspend support</title>
<updated>2010-10-16T23:57:48Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2010-09-25T21:35:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=15bcb91d7e607d8a2e060f01f7784a7454668da4'/>
<id>urn:sha1:15bcb91d7e607d8a2e060f01f7784a7454668da4</id>
<content type='text'>
This patch (as1427) implements the "autosuspend" facility for runtime
PM.  A few new fields are added to the dev_pm_info structure and
several new PM helper functions are defined, for telling the PM core
whether or not a device uses autosuspend, for setting the autosuspend
delay, and for marking periods of device activity.

Drivers that do not want to use autosuspend can continue using the
same helper functions as before; their behavior will not change.  In
addition, drivers supporting autosuspend can also call the old helper
functions to get the old behavior.

The details are all explained in Documentation/power/runtime_pm.txt
and Documentation/ABI/testing/sysfs-devices-power.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Add no_callbacks flag</title>
<updated>2010-10-16T23:57:47Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2010-09-25T21:35:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7490e44239e60293bca0c2663229050c36c660c2'/>
<id>urn:sha1:7490e44239e60293bca0c2663229050c36c660c2</id>
<content type='text'>
Some devices, such as USB interfaces, cannot be power-managed
independently of their parents, i.e., they cannot be put in low power
while the parent remains at full power.  This patch (as1425) creates a
new "no_callbacks" flag, which tells the PM core not to invoke the
runtime-PM callback routines for the such devices but instead to
assume that the callbacks always succeed.  In addition, the
non-debugging runtime-PM sysfs attributes for the devices are removed,
since they are pretty much meaningless.

The advantage of this scheme comes not so much from avoiding the
callbacks themselves, but rather from the fact that without the need
for a process context in which to run the callbacks, more work can be
done in interrupt context.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Wakeup: Introduce wakeup source objects and event statistics (v3)</title>
<updated>2010-10-16T23:57:43Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2010-09-22T20:09:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=074037ec79bea73edf1b1ec72fef1010e83e3cc5'/>
<id>urn:sha1:074037ec79bea73edf1b1ec72fef1010e83e3cc5</id>
<content type='text'>
Introduce struct wakeup_source for representing system wakeup sources
within the kernel and for collecting statistics related to them.
Make the recently introduced helper functions pm_wakeup_event(),
pm_stay_awake() and pm_relax() use struct wakeup_source objects
internally, so that wakeup statistics associated with wakeup devices
can be collected and reported in a consistent way (the definition of
pm_relax() is changed, which is harmless, because this function is
not called directly by anyone yet).  Introduce new wakeup-related
sysfs device attributes in /sys/devices/.../power for reporting the
device wakeup statistics.

Change the global wakeup events counters event_count and
events_in_progress into atomic variables, so that it is not necessary
to acquire a global spinlock in pm_wakeup_event(), pm_stay_awake()
and pm_relax(), which should allow us to avoid lock contention in
these functions on SMP systems with many wakeup devices.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Add runtime PM statistics (v3)</title>
<updated>2010-07-19T00:01:06Z</updated>
<author>
<name>Arjan van de Ven</name>
<email>arjan@linux.intel.com</email>
</author>
<published>2010-07-19T00:01:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8d4b9d1bfef117862a2889dec4dac227068544c9'/>
<id>urn:sha1:8d4b9d1bfef117862a2889dec4dac227068544c9</id>
<content type='text'>
In order for PowerTOP to be able to report how well the new runtime PM is
working for the various drivers, the kernel needs to export some basic
statistics in sysfs.

This patch adds two sysfs files in the runtime PM domain that expose the
total time a device has been active, and the time a device has been
suspended.

With this PowerTOP can compute the activity percentage

Active %age = 100 * (delta active) / (delta active + delta suspended)

and present the information to the user.

I've written the PowerTOP code (slated for version 1.12) already, and the
output looks like this:

Runtime Device Power Management statistics
Active  Device name
 10.0%	06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller

[version 2: fix stat update bugs noticed by Alan Stern]
[version 3: rebase to -next and move the sysfs declaration]

Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Make runtime_status attribute not debug-only (v. 2)</title>
<updated>2010-07-19T00:00:36Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2010-07-07T22:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0fcb4eef8294492c8f1de8236b1ed81f09e42922'/>
<id>urn:sha1:0fcb4eef8294492c8f1de8236b1ed81f09e42922</id>
<content type='text'>
This patch (as1404b) makes the runtime_status sysfs attribute available
even in the absence of CONFIG_PM_ADVANCED_DEBUG, and it changes the
routine to display "unsupported" when runtime PM is disabled for a
device.  Although not strictly 100% accurate, this will almost always
be correct.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM: Make it possible to avoid races between wakeup and system sleep</title>
<updated>2010-07-18T23:58:48Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2010-07-05T20:43:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c125e96f044427f38d106fab7bc5e4a5e6a18262'/>
<id>urn:sha1:c125e96f044427f38d106fab7bc5e4a5e6a18262</id>
<content type='text'>
One of the arguments during the suspend blockers discussion was that
the mainline kernel didn't contain any mechanisms making it possible
to avoid races between wakeup and system suspend.

Generally, there are two problems in that area.  First, if a wakeup
event occurs exactly when /sys/power/state is being written to, it
may be delivered to user space right before the freezer kicks in, so
the user space consumer of the event may not be able to process it
before the system is suspended.  Second, if a wakeup event occurs
after user space has been frozen, it is not generally guaranteed that
the ongoing transition of the system into a sleep state will be
aborted.

To address these issues introduce a new global sysfs attribute,
/sys/power/wakeup_count, associated with a running counter of wakeup
events and three helper functions, pm_stay_awake(), pm_relax(), and
pm_wakeup_event(), that may be used by kernel subsystems to control
the behavior of this attribute and to request the PM core to abort
system transitions into a sleep state already in progress.

The /sys/power/wakeup_count file may be read from or written to by
user space.  Reads will always succeed (unless interrupted by a
signal) and return the current value of the wakeup events counter.
Writes, however, will only succeed if the written number is equal to
the current value of the wakeup events counter.  If a write is
successful, it will cause the kernel to save the current value of the
wakeup events counter and to abort the subsequent system transition
into a sleep state if any wakeup events are reported after the write
has returned.

[The assumption is that before writing to /sys/power/state user space
will first read from /sys/power/wakeup_count.  Next, user space
consumers of wakeup events will have a chance to acknowledge or
veto the upcoming system transition to a sleep state.  Finally, if
the transition is allowed to proceed, /sys/power/wakeup_count will
be written to and if that succeeds, /sys/power/state will be written
to as well.  Still, if any wakeup events are reported to the PM core
by kernel subsystems after that point, the transition will be
aborted.]

Additionally, put a wakeup events counter into struct dev_pm_info and
make these per-device wakeup event counters available via sysfs,
so that it's possible to check the activity of various wakeup event
sources within the kernel.

To illustrate how subsystems can use pm_wakeup_event(), make the
low-level PCI runtime PM wakeup-handling code use it.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Acked-by: markgross &lt;markgross@thegnar.org&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Add sysfs debug files</title>
<updated>2010-05-10T21:08:17Z</updated>
<author>
<name>Dominik Brodowski</name>
<email>linux@dominikbrodowski.net</email>
</author>
<published>2010-04-23T18:32:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c92445fadb9179d811b5cb044947ad4712403541'/>
<id>urn:sha1:c92445fadb9179d811b5cb044947ad4712403541</id>
<content type='text'>
Add a few sysfs files relating to runtime power management for
advanced debug purposes:

runtime_enabled: is runtime PM enabled for this device? States
	are "enabled", "disabled", "forbidden" or a combination
	of the latter two.

runtime_status:	what state is the device in currently? E.g., it
	reports "suspended" for runtime-suspended devices, and
        "active" for active devices. NOTE: if runtime_enabled
	returns "disabled", the value of this file may not
	reflect its physical state.

runtime_usage: the runtime PM usage count of a device

runtime_active_kids: the runtime PM children usage count of a device, or
	0 if the ignore_children flag is set.

Also, CONFIG_PM_SLEEP_ADVANCED_DEBUG is not defined in any Kconfig
file, so replace it with CONFIG_PM_ADVANCED_DEBUG.

Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM: Add facility for advanced testing of async suspend/resume</title>
<updated>2010-02-26T19:39:10Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2010-01-23T21:25:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5a2eb8585f3b38e01e30aacaa8b985a1520a993d'/>
<id>urn:sha1:5a2eb8585f3b38e01e30aacaa8b985a1520a993d</id>
<content type='text'>
Add configuration switch CONFIG_PM_ADVANCED_DEBUG for compiling in
extra PM debugging/testing code allowing one to access some
PM-related attributes of devices from the user space via sysfs.

If CONFIG_PM_ADVANCED_DEBUG is set, add sysfs attribute power/async
for every device allowing the user space to access the device's
power.async_suspend flag and modify it, if desired.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
</feed>
