<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/power, branch v3.7.8</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/base/power?h=v3.7.8</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/base/power?h=v3.7.8'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-01-17T16:46:22Z</updated>
<entry>
<title>PM: Move disabling/enabling runtime PM to late suspend/early resume</title>
<updated>2013-01-17T16:46:22Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2012-12-22T22:59:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=77b130deb4c58c76eec6b55e6ab123a9b280bc4d'/>
<id>urn:sha1:77b130deb4c58c76eec6b55e6ab123a9b280bc4d</id>
<content type='text'>
commit 9f6d8f6ab26b42620a914d67f29822f9bba90233 upstream.

Currently, the PM core disables runtime PM for all devices right
after executing subsystem/driver .suspend() callbacks for them
and re-enables it right before executing subsystem/driver .resume()
callbacks for them.  This may lead to problems when there are
two devices such that the .suspend() callback executed for one of
them depends on runtime PM working for the other.  In that case,
if runtime PM has already been disabled for the second device,
the first one's .suspend() won't work correctly (and analogously
for resume).

To make those issues go away, make the PM core disable runtime PM
for devices right before executing subsystem/driver .suspend_late()
callbacks for them and enable runtime PM for them right after
executing subsystem/driver .resume_early() callbacks for them.  This
way the potential conflitcs between .suspend_late()/.resume_early()
and their runtime PM counterparts are still prevented from happening,
but the subtle ordering issues related to disabling/enabling runtime
PM for devices during system suspend/resume are much easier to avoid.

Reported-and-tested-by: Jan-Matthias Braun &lt;jan_braun@gmx.net&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Reviewed-by: Kevin Hilman &lt;khilman@deeprootsystems.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>PM / QoS: fix wrong error-checking condition</title>
<updated>2012-11-23T19:55:06Z</updated>
<author>
<name>Guennadi Liakhovetski</name>
<email>g.liakhovetski@gmx.de</email>
</author>
<published>2012-11-23T19:55:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a7227a0faa117d0bc532aea546ae5ac5f89e8ed7'/>
<id>urn:sha1:a7227a0faa117d0bc532aea546ae5ac5f89e8ed7</id>
<content type='text'>
dev_pm_qos_add_request() can return 0, 1, or a negative error code,
therefore the correct error test is "if (error &lt; 0)." Checking just for
non-zero return code leads to erroneous setting of the req-&gt;dev pointer
to NULL, which then leads to a repeated call to
dev_pm_qos_add_ancestor_request() in st1232_ts_irq_handler(). This in turn
leads to an Oops, when the I2C host adapter is unloaded and reloaded again
because of the inconsistent state of its QoS request list.

Signed-off-by: Guennadi Liakhovetski &lt;g.liakhovetski@gmx.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / Domains: Fix memory leak on error path in pm_genpd_attach_cpuidle</title>
<updated>2012-10-22T22:54:38Z</updated>
<author>
<name>jhbird.choi@samsung.com</name>
<email>jhbird.choi@samsung.com</email>
</author>
<published>2012-10-22T22:54:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=debe081aaa4d247b9957ac2336d84deab32d9909'/>
<id>urn:sha1:debe081aaa4d247b9957ac2336d84deab32d9909</id>
<content type='text'>
If pm_genpd_attach_cpudidle failed we leak memory stored in 'cpu_data'.

Signed-off-by: Jonghwan Choi &lt;jhbird.choi@samsung.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pm-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2012-10-03T01:32:35Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-10-03T01:32:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=16642a2e7be23bbda013fc32d8f6c68982eab603'/>
<id>urn:sha1:16642a2e7be23bbda013fc32d8f6c68982eab603</id>
<content type='text'>
Pull power management updates from Rafael J Wysocki:

 - Improved system suspend/resume and runtime PM handling for the SH
   TMU, CMT and MTU2 clock event devices (also used by ARM/shmobile).

 - Generic PM domains framework extensions related to cpuidle support
   and domain objects lookup using names.

 - ARM/shmobile power management updates including improved support for
   the SH7372's A4S power domain containing the CPU core.

 - cpufreq changes related to AMD CPUs support from Matthew Garrett,
   Andre Przywara and Borislav Petkov.

 - cpu0 cpufreq driver from Shawn Guo.

 - cpufreq governor fixes related to the relaxing of limit from Michal
   Pecio.

 - OMAP cpufreq updates from Axel Lin and Richard Zhao.

 - cpuidle ladder governor fixes related to the disabling of states from
   Carsten Emde and me.

 - Runtime PM core updates related to the interactions with the system
   suspend core from Alan Stern and Kevin Hilman.

 - Wakeup sources modification allowing more helper functions to be
   called from interrupt context from John Stultz and additional
   diagnostic code from Todd Poynor.

 - System suspend error code path fix from Feng Hong.

Fixed up conflicts in cpufreq/powernow-k8 that stemmed from the
workqueue fixes conflicting fairly badly with the removal of support for
hardware P-state chips.  The changes were independent but somewhat
intertwined.

* tag 'pm-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
  Revert "PM QoS: Use spinlock in the per-device PM QoS constraints code"
  PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2
  cpuidle: rename function name "__cpuidle_register_driver", v2
  cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_hwmod_name
  cpuidle: remove some empty lines
  PM: Prevent runtime suspend during system resume
  PM QoS: Use spinlock in the per-device PM QoS constraints code
  PM / Sleep: use resume event when call dpm_resume_early
  cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure
  ACPI / processor: remove pointless variable initialization
  ACPI / processor: remove unused function parameter
  cpufreq: OMAP: remove loops_per_jiffy recalculate for smp
  sections: fix section conflicts in drivers/cpufreq
  cpufreq: conservative: update frequency when limits are relaxed
  cpufreq / ondemand: update frequency when limits are relaxed
  properly __init-annotate pm_sysrq_init()
  cpufreq: Add a generic cpufreq-cpu0 driver
  PM / OPP: Initialize OPP table from device tree
  ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp
  cpufreq: Remove support for hardware P-state chips from powernow-k8
  ...
</content>
</entry>
<entry>
<title>Merge branch 'pm-qos'</title>
<updated>2012-09-24T19:41:31Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2012-09-24T19:41:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b9142167a2bb979b58b98ffcd928a311b55cbd9f'/>
<id>urn:sha1:b9142167a2bb979b58b98ffcd928a311b55cbd9f</id>
<content type='text'>
* pm-qos:
  Revert "PM QoS: Use spinlock in the per-device PM QoS constraints code"
</content>
</entry>
<entry>
<title>Revert "PM QoS: Use spinlock in the per-device PM QoS constraints code"</title>
<updated>2012-09-24T19:39:36Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2012-09-24T19:39:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8376869e51f5094e87229aa6200c43ada85c9aaf'/>
<id>urn:sha1:8376869e51f5094e87229aa6200c43ada85c9aaf</id>
<content type='text'>
This reverts commit fc2fb3a075c206927d3fbad251dae82ba82ccf2d.

The problem with the above commit is that it makes the device PM QoS
core code hold a spinlock around blocking_notifier_call_chain()
invocations.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pm-sleep'</title>
<updated>2012-09-24T11:31:38Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2012-09-24T11:31:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=057d51a1268fe4be039db8ff0791fcfcb63a4f1b'/>
<id>urn:sha1:057d51a1268fe4be039db8ff0791fcfcb63a4f1b</id>
<content type='text'>
* pm-sleep:
  PM: Prevent runtime suspend during system resume
  PM / Sleep: use resume event when call dpm_resume_early

Conflicts:
	drivers/base/power/main.c (trivial)
</content>
</entry>
<entry>
<title>Merge branch 'pm-runtime'</title>
<updated>2012-09-24T11:30:55Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2012-09-24T11:30:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=071f58279f274f749c4109aef86d899766014139'/>
<id>urn:sha1:071f58279f274f749c4109aef86d899766014139</id>
<content type='text'>
* pm-runtime:
  PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2
</content>
</entry>
<entry>
<title>Merge branch 'pm-qos'</title>
<updated>2012-09-24T11:30:50Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2012-09-24T11:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c26d4114aac55b57078caf83e261621d22e4596d'/>
<id>urn:sha1:c26d4114aac55b57078caf83e261621d22e4596d</id>
<content type='text'>
* pm-qos:
  PM QoS: Use spinlock in the per-device PM QoS constraints code
</content>
</entry>
<entry>
<title>PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2</title>
<updated>2012-09-22T19:15:08Z</updated>
<author>
<name>Kevin Hilman</name>
<email>khilman@ti.com</email>
</author>
<published>2012-09-21T22:47:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6f3c77b040fc24708228607bba504878de5236d1'/>
<id>urn:sha1:6f3c77b040fc24708228607bba504878de5236d1</id>
<content type='text'>
There are several drivers where the return value of
pm_runtime_get_sync() is used to decide whether or not it is safe to
access hardware and that don't provide .suspend() callbacks for system
suspend (but may use late/noirq callbacks.)  If such a driver happens
to call pm_runtime_get_sync() during system suspend, after the core
has disabled runtime PM, it will get the error code and will decide
that the hardware should not be accessed, although this may be a wrong
conclusion, depending on the state of the device when runtime PM was
disabled.

Drivers might work around this problem by using a test like:

   ret = pm_runtime_get_sync(dev);
   if (!ret || (ret == -EACCES &amp;&amp; driver_private_data(dev)-&gt;suspended)) {
      /* access hardware */
   }

where driver_private_data(dev)-&gt;suspended is a flag set by the
driver's .suspend() method (that would have to be added for this
purpose).  However, that potentially would need to be done by multiple
drivers which means quite a lot of duplicated code and bloat.

To avoid that we can use the observation that the core sets
dev-&gt;power.is_suspended before disabling runtime PM and use that
instead of the driver's private flag.  Still, potentially many drivers
would need to repeat that same check in quite a few places, so it's
better to let the core do it.

Then we can be a bit smarter and check whether or not runtime PM was
disabled by the core only (disable_depth == 1) or by someone else in
addition to the core (disable_depth &gt; 1).  In the former case
rpm_resume() can return 1 if the runtime PM status is RPM_ACTIVE,
because it means the device was active when the core disabled runtime
PM.  In the latter case it should still return -EACCES, because it
isn't clear why runtime PM has been disabled.

Tested on AM3730/Beagle-xM where a wakeup IRQ firing during the late
suspend phase triggers runtime PM activity in the I2C driver since the
wakeup IRQ is on an I2C-connected PMIC.

[rjw: Modified whitespace to follow the file's convention.]

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