<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/base/power/main.c, branch linux-2.6.36.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.36.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.36.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2010-09-08T22:49:43Z</updated>
<entry>
<title>PM: Prevent waiting forever on asynchronous resume after failing suspend</title>
<updated>2010-09-08T22:49:43Z</updated>
<author>
<name>Colin Cross</name>
</author>
<published>2010-09-02T23:24:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=152e1d592071c8b312bb898bc1118b64e4aea535'/>
<id>urn:sha1:152e1d592071c8b312bb898bc1118b64e4aea535</id>
<content type='text'>
During suspend, the power.completion is expected to be set when a
device has not yet started suspending.  Set it on init to fix a
corner case where a device is resumed when its parent has never
suspended.

Consider three drivers, A, B, and C.  The parent of A is C, and C
has async_suspend set.  On boot, C-&gt;power.completion is initialized
to 0.

During the first suspend:
suspend_devices_and_enter(...)
 dpm_resume(...)
  device_suspend(A)
  device_suspend(B) returns error, aborts suspend
 dpm_resume_end(...)
   dpm_resume(...)
    device_resume(A)
     dpm_wait(A-&gt;parent == C)
      wait_for_completion(C-&gt;power.completion)

The wait_for_completion will never complete, because
complete_all(C-&gt;power.completion) will only be called from
device_suspend(C) or device_resume(C), neither of which is called
if suspend is aborted before C.

After a successful suspend-&gt;resume cycle, where B doesn't abort
suspend, C-&gt;power.completion is left in the completed state by the
call to device_resume(C), and the same call path will work if B
aborts suspend.

Signed-off-by: Colin Cross &lt;ccross@android.com&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>
</author>
<published>2010-07-05T20:43:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>power: support _noirq actions on device types and classes</title>
<updated>2010-03-24T10:00:02Z</updated>
<author>
<name>Dominik Brodowski</name>
</author>
<published>2010-03-15T20:43:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7176a37d436a214f6a7727ea7986c654cbee8f0'/>
<id>urn:sha1:e7176a37d436a214f6a7727ea7986c654cbee8f0</id>
<content type='text'>
The new-style dev_pm_ops provide callbacks for both IRQs enabled
and disabled. However, the _noirq variants were only called for
buses registered with a device, not for classes and types.

In order to properly use dev_pm_ops in class pcmcia_socket_class,
support _noirq actions also on classes and types.

Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>Driver core: create lock/unlock functions for struct device</title>
<updated>2010-03-08T01:04:52Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2010-02-17T18:57:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8e9394ce2412254ec69fd2a4f3e44a66eade2297'/>
<id>urn:sha1:8e9394ce2412254ec69fd2a4f3e44a66eade2297</id>
<content type='text'>
In the future, we are going to be changing the lock type for struct
device (once we get the lockdep infrastructure properly worked out)  To
make that changeover easier, and to possibly burry the lock in a
different part of struct device, let's create some functions to lock and
unlock a device so that no out-of-core code needs to be changed in the
future.

This patch creates the device_lock/unlock/trylock() functions, and
converts all in-tree users to them.

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jean Delvare &lt;khali@linux-fr.org&gt;
Cc: Dave Young &lt;hidave.darkstar@gmail.com&gt;
Cc: Ming Lei &lt;tom.leiming@gmail.com&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Phil Carmody &lt;ext-phil.2.carmody@nokia.com&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Len Brown &lt;len.brown@intel.com&gt;
Cc: Magnus Damm &lt;damm@igel.co.jp&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Cc: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Cc: Vegard Nossum &lt;vegard.nossum@gmail.com&gt;
Cc: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Cc: Alex Chiang &lt;achiang@hp.com&gt;
Cc: Kenji Kaneshige &lt;kaneshige.kenji@jp.fujitsu.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andrew Patterson &lt;andrew.patterson@hp.com&gt;
Cc: Yu Zhao &lt;yu.zhao@intel.com&gt;
Cc: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Cc: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
Cc: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Cc: CHENG Renquan &lt;rqcheng@smu.edu.sg&gt;
Cc: Oliver Neukum &lt;oliver@neukum.org&gt;
Cc: Frans Pop &lt;elendil@planet.nl&gt;
Cc: David Vrabel &lt;david.vrabel@csr.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
<entry>
<title>PM: Allow device drivers to use dpm_wait()</title>
<updated>2010-02-26T19:39:11Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2010-01-27T22:47:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8824cee405c62ba465b85365201166d9cf86a14'/>
<id>urn:sha1:f8824cee405c62ba465b85365201166d9cf86a14</id>
<content type='text'>
There are some dependencies between devices (in particular, between
EHCI USB controllers and their OHCI/UHCI siblings) which are not
reflected by the structure of the device tree.  With synchronous
suspend and resume these dependencies are taken into accout
automatically, because the devices in question are always registered
in the right order, but to meet these constraints with asynchronous
suspend and resume the drivers of these devices will need to use
dpm_wait() in their suspend/resume routines, so introduce a helper
function allowing them to do that.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM: Start asynchronous resume threads upfront</title>
<updated>2010-02-26T19:39:11Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2010-01-23T21:25:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=97df8c12995c5bac73e3bfeea4c5be155c1f4401'/>
<id>urn:sha1:97df8c12995c5bac73e3bfeea4c5be155c1f4401</id>
<content type='text'>
It has been shown by testing that total device resume time can be
reduced significantly (by as much as 50% or more) if the async
threads executing some devices' resume routines are all started
before the main resume thread starts to handle the "synchronous"
devices.

This is a consequence of the fact that the slowest devices tend to be
located at the end of dpm_list, so their resume routines are started
very late.  Consequently, they have to wait for all the preceding
"synchronous" devices before their resume routines can be started
by the main resume thread, even if they are "asynchronous".  By
starting their async threads upfront we effectively move those
devices towards the beginning of dpm_list, without breaking their
ordering with respect to their parents and children.  As a result,
their resume routines are started much earlier and we are able to
save much more device resume time this way.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM: Add a switch for disabling/enabling asynchronous suspend/resume</title>
<updated>2010-02-26T19:39:10Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2010-01-23T21:25:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e06b4a891c6a108412fe24b4500f499da2cf8a1'/>
<id>urn:sha1:0e06b4a891c6a108412fe24b4500f499da2cf8a1</id>
<content type='text'>
Add sysfs attribute /sys/power/pm_async allowing the user space to
disable/enable asynchronous suspend/resume of devices.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM: Asynchronous suspend and resume of devices</title>
<updated>2010-02-26T19:39:09Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2010-01-23T21:23:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5af84b82701a96be4b033aaa51d86c72e2ded061'/>
<id>urn:sha1:5af84b82701a96be4b033aaa51d86c72e2ded061</id>
<content type='text'>
Theoretically, the total time of system sleep transitions (suspend
to RAM, hibernation) can be reduced by running suspend and resume
callbacks of device drivers in parallel with each other.  However,
there are dependencies between devices such that we're not allowed
to suspend the parent of a device before suspending the device
itself.  Analogously, we're not allowed to resume a device before
resuming its parent.

The most straightforward way to take these dependencies into accout
is to start the async threads used for suspending and resuming
devices at the core level, so that async_schedule() is called for
each suspend and resume callback supposed to be executed
asynchronously.

For this purpose, introduce a new device flag, power.async_suspend,
used to mark the devices whose suspend and resume callbacks are to be
executed asynchronously (ie. in parallel with the main suspend/resume
thread and possibly in parallel with each other) and helper function
device_enable_async_suspend() allowing one to set power.async_suspend
for given device (power.async_suspend is unset by default for all
devices).  For each device with the power.async_suspend flag set the
PM core will use async_schedule() to execute its suspend and resume
callbacks.

The async threads started for different devices as a result of
calling async_schedule() are synchronized with each other and with
the main suspend/resume thread with the help of completions, in the
following way:
(1) There is a completion, power.completion, for each device object.
(2) Each device's completion is reset before calling async_schedule()
    for the device or, in the case of devices with the
    power.async_suspend flags unset, before executing the device's
    suspend and resume callbacks.
(3) During suspend, right before running the bus type, device type
    and device class suspend callbacks for the device, the PM core
    waits for the completions of all the device's children to be
    completed.
(4) During resume, right before running the bus type, device type and
    device class resume callbacks for the device, the PM core waits
    for the completion of the device's parent to be completed.
(5) The PM core completes power.completion for each device right
    after the bus type, device type and device class suspend (or
    resume) callbacks executed for the device have returned.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM: Add parent information to timing messages</title>
<updated>2010-02-26T19:39:09Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2010-01-23T21:03:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8cc6b39ff36b4bbce2d7471da088df122b0e9033'/>
<id>urn:sha1:8cc6b39ff36b4bbce2d7471da088df122b0e9033</id>
<content type='text'>
Add parent information to the messages printed by the suspend/resume
core when initcall_debug is set.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>power: fix kernel-doc notation</title>
<updated>2010-01-11T17:34:06Z</updated>
<author>
<name>Randy Dunlap</name>
</author>
<published>2010-01-08T22:42:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a88422312f5bf7b9e3450e27d8ddc385af38789'/>
<id>urn:sha1:0a88422312f5bf7b9e3450e27d8ddc385af38789</id>
<content type='text'>
Warning(drivers/base/power/main.c:453): No description found for parameter 'dev'
Warning(drivers/base/power/main.c:453): No description found for parameter 'cb'
Warning(drivers/base/power/main.c:719): No description found for parameter 'dev'
Warning(drivers/base/power/main.c:719): No description found for parameter 'state'
Warning(drivers/base/power/main.c:719): No description found for parameter 'cb'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
