<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/power/main.c, branch v3.4.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/power/main.c?h=v3.4.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/power/main.c?h=v3.4.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-02-17T22:36:10Z</updated>
<entry>
<title>PM / Sleep: Make enter_state() in kernel/power/suspend.c static</title>
<updated>2012-02-17T22:36:10Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2012-02-13T15:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=93e1ee43a72b11e1b50aab87046c131a836a4456'/>
<id>urn:sha1:93e1ee43a72b11e1b50aab87046c131a836a4456</id>
<content type='text'>
The enter_state() function in kernel/power/suspend.c should be
static and state_store() in kernel/power/suspend.c should call
pm_suspend() instead of it, so make that happen (which also reduces
code duplication related to suspend statistics).

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>PM / Suspend: Avoid code duplication in suspend statistics update</title>
<updated>2012-02-09T22:55:43Z</updated>
<author>
<name>Marcos Paulo de Souza</name>
<email>marcos.mage@gmail.com</email>
</author>
<published>2012-02-04T21:26:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8916e3702ec422b57cc549fbae3986106292100f'/>
<id>urn:sha1:8916e3702ec422b57cc549fbae3986106292100f</id>
<content type='text'>
The code
       if (error) {
               suspend_stats.fail++;
               dpm_save_failed_errno(error);
       } else
               suspend_stats.success++;

Appears in the kernel/power/main.c and kernel/power/suspend.c.

This patch just creates a new function to avoid duplicated code.

Suggested-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Marcos Paulo de Souza &lt;marcos.mage@gmail.com&gt;
Acked-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Sleep: Introduce "late suspend" and "early resume" of devices</title>
<updated>2012-01-29T19:38:29Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2012-01-29T19:38:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cf579dfb82550e34de7ccf3ef090d8b834ccd3a9'/>
<id>urn:sha1:cf579dfb82550e34de7ccf3ef090d8b834ccd3a9</id>
<content type='text'>
The current device suspend/resume phases during system-wide power
transitions appear to be insufficient for some platforms that want
to use the same callback routines for saving device states and
related operations during runtime suspend/resume as well as during
system suspend/resume.  In principle, they could point their
.suspend_noirq() and .resume_noirq() to the same callback routines
as their .runtime_suspend() and .runtime_resume(), respectively,
but at least some of them require device interrupts to be enabled
while the code in those routines is running.

It also makes sense to have device suspend-resume callbacks that will
be executed with runtime PM disabled and with device interrupts
enabled in case someone needs to run some special code in that
context during system-wide power transitions.

Apart from this, .suspend_noirq() and .resume_noirq() were introduced
as a workaround for drivers using shared interrupts and failing to
prevent their interrupt handlers from accessing suspended hardware.
It appears to be better not to use them for other porposes, or we may
have to deal with some serious confusion (which seems to be happening
already).

For the above reasons, introduce new device suspend/resume phases,
"late suspend" and "early resume" (and analogously for hibernation)
whose callback will be executed with runtime PM disabled and with
device interrupts enabled and whose callback pointers generally may
point to runtime suspend/resume routines.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Reviewed-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
</entry>
<entry>
<title>PM / Sleep: Replace mutex_[un]lock(&amp;pm_mutex) with [un]lock_system_sleep()</title>
<updated>2011-12-08T22:22:29Z</updated>
<author>
<name>Srivatsa S. Bhat</name>
<email>srivatsa.bhat@linux.vnet.ibm.com</email>
</author>
<published>2011-12-07T21:29:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bcda53faf5814c0c6025a0bd47108adfcbe9f199'/>
<id>urn:sha1:bcda53faf5814c0c6025a0bd47108adfcbe9f199</id>
<content type='text'>
Using [un]lock_system_sleep() is safer than directly using mutex_[un]lock()
on 'pm_mutex', since the latter could lead to freezing failures. Hence convert
all the present users of mutex_[un]lock(&amp;pm_mutex) to use these safe APIs
instead.

Suggested-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Reviewed-by: Simon Horman &lt;horms@verge.net.au&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM: Fix indentation and remove extraneous whitespaces in kernel/power/main.c</title>
<updated>2011-11-23T20:13:07Z</updated>
<author>
<name>Srivatsa S. Bhat</name>
<email>srivatsa.bhat@linux.vnet.ibm.com</email>
</author>
<published>2011-11-19T13:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=341d4166175e9b7911444f5a33b1c9efb8f15c85'/>
<id>urn:sha1:341d4166175e9b7911444f5a33b1c9efb8f15c85</id>
<content type='text'>
Lack of proper indentation of the goto statement decreases the readability
of code significantly. In fact, this made me look twice at the code to check
whether it really does what it should be doing. Fix this.

And in the same file, there are some extra whitespaces. Get rid of them too.

Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Suspend: Fix bug in suspend statistics update</title>
<updated>2011-11-19T13:37:57Z</updated>
<author>
<name>Srivatsa S. Bhat</name>
<email>srivatsa.bhat@linux.vnet.ibm.com</email>
</author>
<published>2011-11-19T13:37:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=501a708f18ef911328ffd39f39738b8a7862aa8e'/>
<id>urn:sha1:501a708f18ef911328ffd39f39738b8a7862aa8e</id>
<content type='text'>
After commit 2a77c46de1e3dace73745015635ebbc648eca69c
(PM / Suspend: Add statistics debugfs file for suspend to RAM)
a missing pair of braces inside the state_store() function causes even
invalid arguments to suspend to be wrongly treated as failed suspend
attempts. Fix this.

[rjw: Put the hash/subject of the buggy commit into the changelog.]

Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>kernel: Fix files explicitly needing EXPORT_SYMBOL infrastructure</title>
<updated>2011-10-31T23:30:05Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-05-26T20:00:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6e5fdeedca610df600aabc393c4b1f44b128fe49'/>
<id>urn:sha1:6e5fdeedca610df600aabc393c4b1f44b128fe49</id>
<content type='text'>
These files were getting &lt;linux/module.h&gt; via an implicit non-obvious
path, but we want to crush those out of existence since they cost
time during compiles of processing thousands of lines of headers
for no reason.  Give them the lightweight header that just contains
the EXPORT_SYMBOL infrastructure.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>PM: Fix build issue in main.c for CONFIG_PM_SLEEP unset</title>
<updated>2011-10-16T21:27:46Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-08-11T20:38:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ca123102f69fb260221502ade9bbc069290fae84'/>
<id>urn:sha1:ca123102f69fb260221502ade9bbc069290fae84</id>
<content type='text'>
Suspend statistics should depend on CONFIG_PM_SLEEP, so make that
happen.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Suspend: Add statistics debugfs file for suspend to RAM</title>
<updated>2011-10-16T21:27:45Z</updated>
<author>
<name>ShuoX Liu</name>
<email>shuox.liu@intel.com</email>
</author>
<published>2011-08-10T21:01:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a77c46de1e3dace73745015635ebbc648eca69c'/>
<id>urn:sha1:2a77c46de1e3dace73745015635ebbc648eca69c</id>
<content type='text'>
Record S3 failure time about each reason and the latest two failed
devices' names in S3 progress.
We can check it through 'suspend_stats' entry in debugfs.

The motivation of the patch:

We are enabling power features on Medfield. Comparing with PC/notebook,
a mobile enters/exits suspend-2-ram (we call it s3 on Medfield) far
more frequently. If it can't enter suspend-2-ram in time, the power
might be used up soon.

We often find sometimes, a device suspend fails. Then, system retries
s3 over and over again. As display is off, testers and developers
don't know what happens.

Some testers and developers complain they don't know if system
tries suspend-2-ram, and what device fails to suspend. They need
such info for a quick check. The patch adds suspend_stats under
debugfs for users to check suspend to RAM statistics quickly.

If not using this patch, we have other methods to get info about
what device fails. One is to turn on  CONFIG_PM_DEBUG, but users
would get too much info and testers need recompile the system.

In addition, dynamic debug is another good tool to dump debug info.
But it still doesn't match our utilization scenario closely.
1) user need write a user space parser to process the syslog output;
2) Our testing scenario is we leave the mobile for at least hours.
   Then, check its status. No serial console available during the
   testing. One is because console would be suspended, and the other
   is serial console connecting with spi or HSU devices would consume
   power. These devices are powered off at suspend-2-ram.

Signed-off-by: ShuoX Liu &lt;shuox.liu@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM: Improve error code of pm_notifier_call_chain()</title>
<updated>2011-07-15T21:58:20Z</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2011-07-08T18:53:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f0c077a8b7f9dce590c760a7b2f3c417dffa52d1'/>
<id>urn:sha1:f0c077a8b7f9dce590c760a7b2f3c417dffa52d1</id>
<content type='text'>
This enables pm_notifier_call_chain() to get the actual error code
in the callback rather than always assume -EINVAL by converting all
PM notifier calls to return encapsulate error code with
notifier_from_errno().

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
</feed>
